#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 | #64318555 | Utilizator | |
| Fișier | existaprime.cpp | Dimensiune | 347 B |
| Data încărcării | 29 Aprilie 2026, 12:58 | Scor/rezultat | Eroare de compilare |
existaprime.cpp: In function ‘int main()’: existaprime.cpp:13:17: warning: left operand of comma operator has no effect [-Wunused-value] 13 | for(p=1; p*p<v[i], p++) | ~~~^~~~~ existaprime.cpp:13:27: error: expected ‘;’ before ‘)’ token 13 | for(p=1; p*p<v[i], p++) | ^ | ; existaprime.cpp:16:5: error: ‘ig’ was not declared in this scope; did you mean ‘i’? 16 | ig(nr==2) k++; | ^~ | i existaprime.cpp:18:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 18 | if(k>0) cout<<"DA";l | ^~ existaprime.cpp:18:24: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 18 | if(k>0) cout<<"DA";l | ^ existaprime.cpp:18:24: error: ‘l’ was not declared in this scope
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ă.