#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 | #58119734 | Utilizator | |
Fișier | eratostene.cpp | Dimensiune | 469 B |
Data încărcării | 15 Mai 2025, 08:32 | Scor / rezultat | Eroare de compilare |
eratostene.cpp:2:1: error: 'ifstream' does not name a type ifstream fin("eratostene.in"); ^ eratostene.cpp:3:1: error: 'ofstream' does not name a type ofstream fout("eratostene.out"); ^ eratostene.cpp: In function 'int main()': eratostene.cpp:9:15: warning: left operand of comma operator has no effect [-Wunused-value] for(i=2; i<=1000, i++) ^ eratostene.cpp:9:26: error: expected ';' before ')' token for(i=2; i<=1000, i++) ^ eratostene.cpp:13:25: warning: right operand of comma operator has no effect [-Wunused-value] for(j=2, j*i<=100000; j++) ^ eratostene.cpp:13:38: error: expected ';' before ')' token for(j=2, j*i<=100000; j++) ^ eratostene.cpp:17:5: error: 'fin' was not declared in this scope fin>>n; ^ eratostene.cpp:18:14: warning: left operand of comma operator has no effect [-Wunused-value] for(i=1;i<=n,i++) ^ eratostene.cpp:18:21: error: expected ';' before ')' token for(i=1;i<=n,i++) ^ eratostene.cpp:21:18: error: 'ciur' cannot be used as a function if(ciur(x) ==0) ^ eratostene.cpp:24:5: error: 'fout' was not declared in this scope fout<<cnt<<'\n'; ^
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ă.