#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 | #64939003 | Utilizator | |
| Fișier | existaprime.cpp | Dimensiune | 355 B |
| Data încărcării | 17 Iunie 2026, 21:49 | Scor/rezultat | Eroare de compilare |
existaprime.cpp: In function ‘int main()’: existaprime.cpp:11:13: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 11 | if (m%j==0) | ^~ existaprime.cpp:13:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 13 | if ( | ^~ existaprime.cpp:14:5: warning: init-statement in selection statements only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions] 14 | if (ok==0) | ^~ existaprime.cpp:14:5: error: expected primary-expression before ‘if’ existaprime.cpp:16:5: error: expected primary-expression before ‘else’ 16 | else | ^~~~ existaprime.cpp:15:20: error: expected ‘)’ before ‘else’ 15 | cout<<"DA"; | ^ | ) 16 | else | ~~~~ existaprime.cpp:13:20: note: to match this ‘(’ 13 | if ( | ^
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ă.