#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 | #65015266 | Utilizator | |
| Fișier | cifimp.cpp | Dimensiune | 571 B |
| Data încărcării | 15 Iulie 2026, 10:38 | Scor/rezultat | Eroare de compilare |
cifimp.cpp: In function ‘int main()’: cifimp.cpp:9:19: error: expected ‘;’ before ‘if’ 9 | n= 100*a+10*b+c | ^ | ; 10 | if(a%2=0 and b%2=1 and c%2=1) cout<<2; | ~~ cifimp.cpp:11:1: error: ‘else’ without a previous ‘if’ 11 | else | ^~~~ cifimp.cpp:12:23: error: lvalue required as left operand of assignment 12 | if(a%2=0 and b%2=0 and c%2=1) cout<<1; | ~~^~~~~~~ cifimp.cpp:14:23: error: lvalue required as left operand of assignment 14 | if(a%2=0 and b%2=1 and c%2=0) cout<<1; | ~~^~~~~~~ cifimp.cpp:16:23: error: lvalue required as left operand of assignment 16 | if(a%2=0 and b%2=1 and c%2=1) cout<<2; | ~~^~~~~~~ cifimp.cpp:18:24: error: lvalue required as left operand of assignment 18 | if(a%2=0 and b%2=0 and c%2=0) cout<<0; | ~~^~~~~~~ cifimp.cpp:20:24: error: lvalue required as left operand of assignment 20 | if(a%2=1 and b%2=0 and c%2=1) cout<<2; | ~~^~~~~~~ cifimp.cpp:22:24: error: lvalue required as left operand of assignment 22 | if(a%2=1 and b%2=1 and c%2=0) cout<<2; | ~~^~~~~~~ cifimp.cpp:24:24: error: lvalue required as left operand of assignment 24 | if(a%2=1 and b%2=0 and c%2=0) cout<<1; | ~~^~~~~~~ cifimp.cpp:26:24: error: lvalue required as left operand of assignment 26 | if(a%2=1 and b%2=1 and c%2=1) cout<<3; | ~~^~~~~~~
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ă.