#506
Se dă un şir cu n elemente, numere naturale. Să se verifice dacă în șir există elemente prime.
| Problema | ExistaPrime | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64932670 | Utilizator | |
| Fișier | existaprime.cpp | Dimensiune | 405 B |
| Data încărcării | 16 Iunie 2026, 09:29 | Scor/rezultat | Eroare de compilare |
existaprime.cpp: In function ‘int main()’: existaprime.cpp:3:1: error: ‘cin’ was not declared in this scope 3 | cin>>n; | ^~~ existaprime.cpp:17:10: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 17 | {if(x%d==0) | ^~ existaprime.cpp:19:13: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 19 | d++;} | ^ existaprime.cpp:26:5: error: ‘cout’ was not declared in this scope 26 | cout<<"DA"; | ^~~~ existaprime.cpp:28:5: error: ‘cout’ was not declared in this scope 28 | cout<<"NU"; | ^~~~ existaprime.cpp:27:1: warning: this ‘else’ clause does not guard... [-Wmisleading-indentation] 27 | else | ^~~~ existaprime.cpp:30:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘else’ 30 | return 0; | ^~~~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ExistaPrime 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ă.