#289
ExistaImpare
Se dă un şir cu n
elemente, numere naturale. Să se verifice dacă în şir există elemente impare.
Problema | ExistaImpare | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #50274148 | Utilizator | |
Fișier | existaimpare.cpp | Dimensiune | 364 B |
Data încărcării | 03 Aprilie 2024, 08:14 | Scor / rezultat | Eroare de compilare |
existaimpare.cpp:4:7: error: expected nested-name-specifier before 'name' using name space std; ^ existaimpare.cpp:4:7: error: 'name' has not been declared existaimpare.cpp:4:12: error: expected ';' before 'space' using name space std; ^ existaimpare.cpp:4:12: error: 'space' does not name a type existaimpare.cpp: In function 'int main()': existaimpare.cpp:7:4: error: 'cin' was not declared in this scope cin>>n; ^ existaimpare.cpp:7:4: note: suggested alternative: In file included from existaimpare.cpp:3:0: /usr/include/c++/4.8/iostream:60:18: note: 'std::cin' extern istream cin; /// Linked to standard input ^ existaimpare.cpp:7:9: error: 'n' was not declared in this scope cin>>n; ^ existaimpare.cpp:8:8: error: 'i' was not declared in this scope for(i=1;i<=n;i++){ ^ existaimpare.cpp:9:13: error: 'x' was not declared in this scope cin>>x[i]; ^ existaimpare.cpp:10:18: error: expected ';' before ')' token for(x[i]<2) ^ existaimpare.cpp:12:8: error: expected primary-expression before 'else' else ^ existaimpare.cpp:12:8: error: expected ';' before 'else' existaimpare.cpp:12:8: error: expected primary-expression before 'else' existaimpare.cpp:12:8: error: expected ')' before 'else' existaimpare.cpp:12:8: error: expected primary-expression before 'else' existaimpare.cpp:12:8: error: expected ';' before 'else' existaimpare.cpp:14:12: error: 'd' was not declared in this scope for(d=2;d*d<=x[i];d++) ^ existaimpare.cpp:16:8: error: 'prim' was not declared in this scope prim=0; ^ existaimpare.cpp:17:11: error: 'prim' was not declared in this scope if(prim==1) ^ existaimpare.cpp:18:8: error: 'ok' was not declared in this scope ok=1; ^ existaimpare.cpp:21:4: error: 'ok' was not declared in this scope if(ok==1) ^ existaimpare.cpp:22:1: error: 'cout' was not declared in this scope cout<<"DA"; ^ existaimpare.cpp:22:1: note: suggested alternative: In file included from existaimpare.cpp:3:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ existaimpare.cpp:24:1: error: 'cout' was not declared in this scope cout<<"NU"; ^ existaimpare.cpp:24:1: note: suggested alternative: In file included from existaimpare.cpp:3: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 ExistaImpare 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ă.