#109
Paritate
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 | #50659308 | Utilizator | |
Fișier | paritate.cpp | Dimensiune | 414 B |
Data încărcării | 18 Aprilie 2024, 22:21 | Scor / rezultat | Eroare de compilare |
paritate.cpp: In function 'int main()': paritate.cpp:6:9: error: expected initializer before 'cout' cout<<"adja meg az elso egesz szamot"; ^ paritate.cpp:7:5: error: 'cin' was not declared in this scope cin>> szam1 ^ paritate.cpp:7: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: expected ';' before 'cout' cout<<"adja meg a masodik egesz szamot"; ^ paritate.cpp:9:10: error: 'szam2' was not declared in this scope cin>>szam2; ^ paritate.cpp:13:9: error: 'cout' was not declared in this scope cout<<"a nagyobb szam"<<szam1 ^ paritate.cpp:13: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:14:5: error: expected ';' before '}' token } else if (szam1>szam2) { ^ paritate.cpp:15:9: error: 'cout' was not declared in this scope cout<<" a nagyobb szam"<<szam2; ^ paritate.cpp:15: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:17:9: error: 'cout' was not declared in this scope cout<<"a ket szam egyenlo"; ^ paritate.cpp:17: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ă.