#633
Se dă un șir cu n
elemente, numere naturale. Determinați diferența în valoare absolută dintre numărul de valori pare din șir și numărul de valori impare din șir.
Problema | Paritate1 | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #57098551 | Utilizator | |
Fișier | paritate1.cpp | Dimensiune | 403 B |
Data încărcării | 16 Martie 2025, 13:55 | Scor / rezultat | Eroare de compilare |
paritate1.cpp:3:7: error: expected nested-name-specifier before 'namesapce' using namesapce std; ^ paritate1.cpp:3:7: error: 'namesapce' has not been declared paritate1.cpp:3:17: error: expected ';' before 'std' using namesapce std; ^ paritate1.cpp:3:17: error: 'std' does not name a type paritate1.cpp: In function 'int main()': paritate1.cpp:11:5: error: 'cin' was not declared in this scope cin >> n; ^ paritate1.cpp:11:5: note: suggested alternative: In file included from paritate1.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: 'std::cin' extern istream cin; /// Linked to standard input ^ paritate1.cpp:22:5: error: 'cout' was not declared in this scope cout << abs(nrPare - nrImpare); ^ paritate1.cpp:22:5: note: suggested alternative: In file included from paritate1.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ paritate1.cpp:24:10: error: expected ';' before ':' token return 0: ^ paritate1.cpp:24:10: error: expected primary-expression before ':' token paritate1.cpp:24:10: error: expected ';' before ':' token
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Paritate1 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ă.