| 20472 | 2026-01-07 07:07:42 | Bikficc | Oszthatóság 31-gyel | cpp17 | Compilation error |
#include <iostream>
#include <vector>
using namespace std;
int main()
{
int n, ok=0;
cin >> n;
if (k>=1 && sor[k-1]==0)
{
cout << "IGEN\n";
}
else
{
cout << "NEM\n";
}
vector <int> sor;
do
{
n=n/10-(n%10)*3;
if (n>=0)
{
sor.push_back(n);
}
}
while (n>0);
int k=sor.size();
if (k>=1 && sor[k-1]==0)
{
cout << "IGEN\n";
}
else
{
cout << "NEM\n";
}
for (int i=0; i<k; i++)
cout << sor[i]<< " ";
cout <<endl;
return 0;
}open /var/local/lib/isolate/429/box/a.out: no such file or directory
main.cpp: In function 'int main()':
main.cpp:10:9: error: 'k' was not declared in this scope; did you mean 'ok'?
10 | if (k>=1 && sor[k-1]==0)
| ^
| ok
main.cpp:10:17: error: 'sor' was not declared in this scope
10 | if (k>=1 && sor[k-1]==0)
| ^~~