#109
Să se scrie un program care citeşte de la tastatură un număr natural şi verifică dacă numărul este par sau impar.
| Problema | Paritate | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64823417 | Utilizator | |
| Fișier | paritate.cpp | Dimensiune | 203 B |
| Data încărcării | 03 Iunie 2026, 19:27 | Scor/rezultat | Eroare de compilare |
paritate.cpp: In function ‘int main()’: paritate.cpp:9:17: warning: statement has no effect [-Wunused-value] 9 | cout<<n;" este par"; | ^~~~~~~~~~~ paritate.cpp:10:5: error: expected ‘}’ before ‘else’ 10 | else | ^~~~ paritate.cpp:8:5: note: to match this ‘{’ 8 | { | ^ paritate.cpp:10:5: warning: this ‘else’ clause does not guard... [-Wmisleading-indentation] 10 | else | ^~~~ paritate.cpp:11:13: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘else’ 11 | cout<<n;" este impar"; | ^~~~~~~~~~~~~ paritate.cpp:11:13: warning: statement has no effect [-Wunused-value] paritate.cpp: At global scope: paritate.cpp:13:5: error: expected unqualified-id before ‘return’ 13 | return 0; | ^~~~~~ paritate.cpp:14:1: error: expected declaration before ‘}’ token 14 | } | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Paritate 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ă.