#3313
Se dau n numere naturale. Aflaţi pentru fiecare număr câţi factori primi are în descompunere.
NeuroN
| Problema | Eratostene2 | Operații I/O |
eratostene2.in/eratostene2.out
|
|---|---|---|---|
| Limita timp | 0.2 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #62679319 | Utilizator | |
| Fișier | eratostene2.cpp | Dimensiune | 390 B |
| Data încărcării | 29 Ianuarie 2026, 12:40 | Scor/rezultat | Eroare de compilare |
eratostene2.cpp:2:20: error: found ':' in nested-name-specifier, expected '::' using namespace std: ^ eratostene2.cpp:3:1: error: 'ifstream' is not a namespace-name ifstream fin("eratostene2.in") ^ eratostene2.cpp:3:10: error: expected namespace-name before 'fin' ifstream fin("eratostene2.in") ^ eratostene2.cpp:3:10: error: expected ';' before 'fin' eratostene2.cpp:3:13: error: expected constructor, destructor, or type conversion before '(' token ifstream fin("eratostene2.in") ^ eratostene2.cpp: In function 'int main()': eratostene2.cpp:8:13: error: 'i' was not declared in this scope for (i=2; i<1000; i++) ^ eratostene2.cpp:9:15: error: 'v' was not declared in this scope if(v[i]==0); ^ eratostene2.cpp:10:12: error: 'j' was not declared in this scope for(j=2*i; j<=1000000; j+=1) v[j]++; ^ eratostene2.cpp:10:16: error: 'i' was not declared in this scope for(j=2*i; j<=1000000; j+=1) v[j]++; ^ eratostene2.cpp:10:37: error: 'v' was not declared in this scope for(j=2*i; j<=1000000; j+=1) v[j]++; ^ eratostene2.cpp:11:12: error: 'fin' was not declared in this scope fin>>n; ^ eratostene2.cpp:11:17: error: 'n' was not declared in this scope fin>>n; ^ eratostene2.cpp:12:12: error: 'i' was not declared in this scope for(i=1; i<=n; i++) ^ eratostene2.cpp:14:17: error: 'x' was not declared in this scope fin>>x; ^ eratostene2.cpp:15:12: error: 'fout' was not declared in this scope fout<<v[x]<<" "; ^ eratostene2.cpp:15:18: error: 'v' was not declared in this scope fout<<v[x]<<" "; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Eratostene2 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ă.