#303
Eratostene
Se dau n
numere naturale mai mici decât 1.000.000
. Determinaţi câte dintre ele sunt prime.
Problema | Eratostene | Operații I/O |
eratostene.in /eratostene.out
|
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54864382 | Utilizator | |
Fișier | eratostene.cpp | Dimensiune | 410 B |
Data încărcării | 10 Decembrie 2024, 18:28 | Scor / rezultat | Eroare de compilare |
eratostene.cpp:4:13: warning: missing terminating " character [enabled by default] ifstream in("eratostene.in ^ eratostene.cpp:4:1: error: missing terminating " character ifstream in("eratostene.in ^ eratostene.cpp:5:7: error: 'i' has not been declared int n,i,k,x[1000001],nr,t; ^ eratostene.cpp:5:9: error: 'k' has not been declared int n,i,k,x[1000001],nr,t; ^ eratostene.cpp:5:11: error: 'x' has not been declared int n,i,k,x[1000001],nr,t; ^ eratostene.cpp:5:22: error: 'nr' has not been declared int n,i,k,x[1000001],nr,t; ^ eratostene.cpp:5:25: error: 't' has not been declared int n,i,k,x[1000001],nr,t; ^ eratostene.cpp:5:26: error: expected ')' before ';' token int n,i,k,x[1000001],nr,t; ^ eratostene.cpp: In function 'int main()': eratostene.cpp:8:6: error: 'x' was not declared in this scope x[0]=x[1]=1; ^ eratostene.cpp:9:10: error: 'i' was not declared in this scope for(i=2;i*i<=1000000;i++) ^ eratostene.cpp:11:13: error: 'k' was not declared in this scope for(k=2;k*i<=1000000;k++) ^ eratostene.cpp:13:9: error: 'cin' was not declared in this scope cin>>n; ^ eratostene.cpp:13:14: error: 'n' was not declared in this scope cin>>n; ^ eratostene.cpp:14:13: error: 'i' was not declared in this scope for(i=1;i<=n;i++) ^ eratostene.cpp:16:18: error: 't' was not declared in this scope cin>>t; ^ eratostene.cpp:18:17: error: 'nr' was not declared in this scope nr++; ^ eratostene.cpp:20:6: error: 'cout' was not declared in this scope cout<<nr; ^ eratostene.cpp:20:12: error: 'nr' was not declared in this scope cout<<nr; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Eratostene 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ă.