#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 | #63040391 | Utilizator | |
| Fișier | paritate.cpp | Dimensiune | 206 B |
| Data încărcării | 11 Februarie 2026, 12:59 | Scor/rezultat | Eroare de compilare |
paritate.cpp:2:7: error: expected nested-name-specifier before 'namestape' using namestape std; ^ paritate.cpp:2:7: error: 'namestape' has not been declared paritate.cpp:2:17: error: expected ';' before 'std' using namestape std; ^ paritate.cpp:2:17: error: 'std' does not name a type paritate.cpp: In function 'int main()': paritate.cpp:5:5: error: 'cin' was not declared in this scope cin<<n; ^ paritate.cpp:5:5: note: suggested alternative: In file included from paritate.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: 'std::cin' extern istream cin; /// Linked to standard input ^ paritate.cpp:5:10: error: 'n' was not declared in this scope cin<<n; ^ paritate.cpp:6:8: error: 'a' was not declared in this scope if(a%2==0) ^ paritate.cpp:8:9: error: 'cout' was not declared in this scope cout<<n<<"este par"; ^ paritate.cpp:8:9: note: suggested alternative: In file included from paritate.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ paritate.cpp:12:9: error: 'cout' was not declared in this scope cout<<n<<"nu este par"; ^ paritate.cpp:12:9: note: suggested alternative: In file included from paritate.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^
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ă.