3882021-11-03 08:23:22arralToronyépítés (1,1,3,3)cpp11Compilation error
#include <iostream>
#include <vector>
using namespace std;
int main()
{
   
	int magasság=0;
	cin >> magasság;
	vector<unsigned long long> lista(magasság+1,0);
	lista[0] = 0;
	lista[1] = 2;
	lista[2] = 4;
	lista[3] = 10;

	for (size_t i = 4; i < magasság+1; i++)
	{
		lista[i] = (2*lista[i - 3] + 2*lista[i-1]) % 20210108;
	}
	
	if (magasság == 1)
	{
		cout << lista[1];
	}
	else if (magasság == 2)
	{
		cout << lista[2];
	}
	else if (magasság == 3)
	{
		cout << lista[3];
	}
	else
	{
		
		cout << lista[magasság];
	}


}
Compilation error
exit status 1main.cpp:7:12: error: stray ‘\341’ in program
    7 |  int magass�g=0;
      |            ^
main.cpp:8:15: error: stray ‘\341’ in program
    8 |  cin >> magass�g;
      |               ^
main.cpp:9:41: error: stray ‘\341’ in program
    9 |  vector<unsigned long long> lista(magass�g+1,0);
      |                                         ^
main.cpp:15:31: error: stray ‘\341’ in program
   15 |  for (size_t i = 4; i < magass�g+1; i++)
      |                               ^
main.cpp:20:12: error: stray ‘\341’ in program
   20 |  if (magass�g == 1)
      |            ^
main.cpp:24:17: error: stray ‘\341’ in program
   24 |  else if (magass�g == 2)
      |                 ^
main.cpp:28:17: error: stray ‘\341’ in program
   28 |  else if (magass�g == 3)
      |                 ^
main.cpp:35:23: error: stray ‘\341’ in program
   35 |   cout << lista[magass�g];
      |                       ^
main.cpp: In function ‘int main()’:
main.cpp:7:13: error: expected initializer before ‘g’
    7 |  int magass�g=0;
      |             ^
main.cpp:8:9: error: ‘magass’ was not declared in this scope
    8 |  cin >> magass�g;
      |         ^~~~~~
main.cpp:9:41: error: expected ‘)’ before ‘g’
    9 |  vector<unsigned long long> lista(magass�g+1,0);
      |                                  ~      ^~
      |                                         )
main.cpp:15:31: error: expected ‘;’ before ‘g’
   15 |  for (size_t i = 4; i < magass�g+1; i++)
      |                               ^~
      |                               ;
main.cpp:15:32: error: ‘g’ was not declared in this scope
   15 |  for (size_t i = 4; i < magass�g+1; i++)
      |                                ^
main.cpp:15:35: error: expected ‘)’ before ‘;’ token
   15 |  for (size_t i = 4; i < magass�g+1; i++)
      |      ~                            ^
      |                                   )
main.cpp:15:37: error: ‘i’ was not declared in this scope
   15 |  for (size_t i = 4; i < magass�g+1; i++)
      |                                     ^
main.cpp:20:12: error: expected ‘)’ before ‘g’
   20 |  if (magass�g == 1)
      |     ~      ^~
      |            )
main.cpp:24:17: error: expected ‘)’ before ‘g’
   24 |  else if (magass�g == 2)
      |          ~      ^~
      |                 )
main.cpp:28:17: error: expected ‘)’ before ‘g’
   28 |  else if (magass�g == 3)
      |          ~      ^~
      |                 )
main.cpp:35:23: error: expected ‘]’ before ‘g’
   35 |   cout << lista[magass�g];
      |                       ^~
      |                       ]
Exited with error status 1