#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 | #47654330 | Utilizator | |
| Fișier | paritate.cpp | Dimensiune | 221 B |
| Data încărcării | 20 Decembrie 2023, 21:21 | Scor/rezultat | Eroare de compilare |
paritate.cpp:2:7: error: expected nested-name-specifier before 'namesace' using namesace std; ^ paritate.cpp:2:7: error: 'namesace' has not been declared paritate.cpp:2:16: error: expected ';' before 'std' using namesace std; ^ paritate.cpp:2:16: error: 'std' does not name a type paritate.cpp: In function 'int main()': paritate.cpp:6:5: error: 'cin' was not declared in this scope cin >> n; ^ paritate.cpp:6: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:8:9: error: 'cout' was not declared in this scope cout << "numarul 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:10:10: error: 'couty' was not declared in this scope couty << "numarul este impar"; ^
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ă.