| 14195 | 2025-01-10 08:50:29 | DhaneHane | Oszthatóság 31-gyel | cpp17 | Forditási hiba |
#include <iostream>
using namespace std;
int main()
{
int m = 1, n, h=0, i=0, v[10000];
cin >> n;
int m = n;
while (m>0){
m = m / 10 - (m % 10 * 3);
if (m >= 0) {
++i;
v[i] = m;
++h;
}
}
if (m==0) cout<<"IGEN"<<"\n";
else cout<<"NEM"<<"\n";
if (n == 0) cout << n;
for (int i = 1; i <= h; ++i) {
cout << v[i] << " ";
}
cout << "\n";
return 0;
}
open /var/local/lib/isolate/411/box/a.out: no such file or directory
main.cpp: In function 'int main()':
main.cpp:9:9: error: redeclaration of 'int m'
9 | int m = n;
| ^
main.cpp:7:9: note: 'int m' previously declared here
7 | int m = 1, n, h=0, i=0, v[10000];
| ^