#3303
Pentru un număr dat x, considerăm următoarele noțiuni:
x reprezintă numărul scris cu cifrele lui x în ordine inversă;x reprezintă diferența dintre numărul format cu atâtea cifre de 9 câte cifre are x și numărul x;x este curat dacă oglinditul său este egal cu urma sa. De exemplu, 27 este un număr curat.Se dau cel mult 1000 numere naturale mai mici decât 100.000.000. Să se stabilească despre fiecare număr dacă este sau nu curat.
| Problema | nrcurat | Operații I/O |
nrcurat.in/nrcurat.out
|
|---|---|---|---|
| Limita timp | 1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #54181312 | Utilizator | |
| Fișier | nrcurat.cpp | Dimensiune | 290 B |
| Data încărcării | 21 Noiembrie 2024, 14:12 | Scor/rezultat | Eroare de compilare |
nrcurat.cpp:3:1: error: stray '\342' in program ifstream f (“nrcurat.in”); ofstream g (“nrcurat.out”); int x, ogl, x9, xc, ur; ^ nrcurat.cpp:3:1: error: stray '\200' in program nrcurat.cpp:3:1: error: stray '\234' in program nrcurat.cpp:3:1: error: stray '\342' in program nrcurat.cpp:3:1: error: stray '\200' in program nrcurat.cpp:3:1: error: stray '\235' in program nrcurat.cpp:3:1: error: stray '\342' in program nrcurat.cpp:3:1: error: stray '\200' in program nrcurat.cpp:3:1: error: stray '\234' in program nrcurat.cpp:3:1: error: stray '\342' in program nrcurat.cpp:3:1: error: stray '\200' in program nrcurat.cpp:3:1: error: stray '\235' in program nrcurat.cpp:7:1: error: stray '\342' in program while(!f.eof()) { f>>x; { xc=x; while(xc) { ogl = ogl*10+xc%10; x9=x9*10+9; xc/=10; } ur=x9-x; if(ogl==ur) g<<1<<’ ‘; else g<<0<<’ ‘; } ^ nrcurat.cpp:7:1: error: stray '\200' in program nrcurat.cpp:7:1: error: stray '\231' in program nrcurat.cpp:7:1: error: stray '\342' in program nrcurat.cpp:7:1: error: stray '\200' in program nrcurat.cpp:7:1: error: stray '\230' in program nrcurat.cpp:7:1: error: stray '\342' in program nrcurat.cpp:7:1: error: stray '\200' in program nrcurat.cpp:7:1: error: stray '\231' in program nrcurat.cpp:7:1: error: stray '\342' in program nrcurat.cpp:7:1: error: stray '\200' in program nrcurat.cpp:7:1: error: stray '\230' in program nrcurat.cpp:3:16: error: 'nrcurat' was not declared in this scope ifstream f (“nrcurat.in”); ofstream g (“nrcurat.out”); int x, ogl, x9, xc, ur; ^ nrcurat.cpp:3:47: error: 'nrcurat' was not declared in this scope ifstream f (“nrcurat.in”); ofstream g (“nrcurat.out”); int x, ogl, x9, xc, ur; ^ nrcurat.cpp: In function 'int main()': nrcurat.cpp:7:121: error: expected primary-expression before ';' token while(!f.eof()) { f>>x; { xc=x; while(xc) { ogl = ogl*10+xc%10; x9=x9*10+9; xc/=10; } ur=x9-x; if(ogl==ur) g<<1<<’ ‘; else g<<0<<’ ‘; } ^ nrcurat.cpp:7:141: error: expected primary-expression before ';' token while(!f.eof()) { f>>x; { xc=x; while(xc) { ogl = ogl*10+xc%10; x9=x9*10+9; xc/=10; } ur=x9-x; if(ogl==ur) g<<1<<’ ‘; else g<<0<<’ ‘; } ^ nrcurat.cpp:7:143: error: expected '}' at end of input while(!f.eof()) { f>>x; { xc=x; while(xc) { ogl = ogl*10+xc%10; x9=x9*10+9; xc/=10; } ur=x9-x; if(ogl==ur) g<<1<<’ ‘; else g<<0<<’ ‘; } ^ nrcurat.cpp:7:143: error: expected '}' at end of input
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema nrcurat face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.