#506
ExistaPrime
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 | #14302553 | Utilizator | |
Fișier | existaprime.cpp | Dimensiune | 286 B |
Data încărcării | 27 Februarie 2019, 21:52 | Scor / rezultat | Eroare de compilare |
existaprime.cpp:1:1: error: 'Int' does not name a type Int n, a [201],ok,nr,i,d; ^ existaprime.cpp: In function 'int main()': existaprime.cpp:4:1: error: 'cin' was not declared in this scope cin>>n; ^ existaprime.cpp:4:6: error: 'n' was not declared in this scope cin>>n; ^ existaprime.cpp:5:5: error: 'i' was not declared in this scope for(i=1:i <=n;i++) ^ existaprime.cpp:5:8: error: expected ';' before ':' token for(i=1:i <=n;i++) ^ existaprime.cpp:5:18: error: expected ';' before ')' token for(i=1:i <=n;i++) ^ existaprime.cpp:6:6: error: 'a' was not declared in this scope cin>>a [i]; ^ existaprime.cpp:7:1: error: 'nr' was not declared in this scope nr=0; ^ existaprime.cpp:8:6: error: 'i' was not declared in this scope for (i=1;i <=n;i++) ^ existaprime.cpp:10:1: error: 'ok' was not declared in this scope ok=1; ^ existaprime.cpp:11:5: error: 'a' was not declared in this scope if (a [i]==0||a [i]==1) ^ existaprime.cpp:13:6: error: 'd' was not declared in this scope for (d=2;d<=a [i]/2;d++) ^ existaprime.cpp:13:13: error: 'a' was not declared in this scope for (d=2;d<=a [i]/2;d++) ^ existaprime.cpp:20:1: error: 'cout' was not declared in this scope cout <<"Nu exista"; ^ existaprime.cpp:21:6: error: 'cout' was not declared in this scope else cout <<"Exista"; ^
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ă.