#2576
Să se afișeze numerele prime de la 1 la n.
| Problema | Ciurul Lui Eratosthenes | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64466854 | Utilizator | |
| Fișier | ciurul_lui_eratosthenes.cpp | Dimensiune | 258 B |
| Data încărcării | 08 Mai 2026, 13:12 | Scor/rezultat | Eroare de compilare |
ciurul_lui_eratosthenes.cpp:1:10: error: #include expects "FILENAME" or <FILENAME> 1 | #include ,iostream> | ^ ciurul_lui_eratosthenes.cpp:2:7: error: expected nested-name-specifier before ‘namspace’ 2 | using namspace std; | ^~~~~~~~ ciurul_lui_eratosthenes.cpp: In function ‘int main()’: ciurul_lui_eratosthenes.cpp:5:5: error: ‘cin’ was not declared in this scope 5 | cin>>n; | ^~~ ciurul_lui_eratosthenes.cpp:8:9: error: ‘ciur’ was not declared in this scope 8 | ciur[j]=1; | ^~~~ ciurul_lui_eratosthenes.cpp:6:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 6 | for(i=2;i*i<=n;i++) | ^~~ ciurul_lui_eratosthenes.cpp:9:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 9 | for(i=2;i<=n;i++) | ^~~ ciurul_lui_eratosthenes.cpp:10:12: error: ‘ciur’ was not declared in this scope 10 | if(ciur[i]=0) | ^~~~ ciurul_lui_eratosthenes.cpp:11:9: error: ‘cout’ was not declared in this scope 11 | cout<< i << " "; | ^~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Ciurul Lui Eratosthenes 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ă.