#452
Se citește de la tastatură un număr natural de 3 cifre. Să se determine câte cifre impare conține.
| Problema | cifimp | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64908752 | Utilizator | |
| Fișier | cifimp.cpp | Dimensiune | 449 B |
| Data încărcării | 11 Iunie 2026, 17:17 | Scor/rezultat | Eroare de compilare |
cifimp.cpp: In function ‘int main()’: cifimp.cpp:10:9: error: ‘contor’ was not declared in this scope; did you mean ‘contr’? 10 | contor++; | ^~~~~~ | contr cifimp.cpp:9:6: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 9 | if(cifra %2 == 1) | ^~ cifimp.cpp:15:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 15 | a = a/10; | ^ cifimp.cpp:19:9: error: ‘contor’ was not declared in this scope; did you mean ‘contr’? 19 | contor++; | ^~~~~~ | contr cifimp.cpp:18:6: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 18 | if(cifra %2 == 1) | ^~ cifimp.cpp:21:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 21 | a = a/10; | ^ cifimp.cpp:24:9: error: ‘contor’ was not declared in this scope; did you mean ‘contr’? 24 | contor++; | ^~~~~~ | contr cifimp.cpp:25:13: error: ‘contor’ was not declared in this scope; did you mean ‘contr’? 25 | cout << contor; | ^~~~~~ | contr cifimp.cpp:30:18: error: expected ‘}’ at end of input 30 | return 0; | ^ cifimp.cpp:5:1: note: to match this ‘{’ 5 | { | ^ cifimp.cpp:6:17: warning: unused variable ‘contr’ [-Wunused-variable] 6 | int a,cifra,contr=0; | ^~~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema cifimp 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ă.