#3314
Eratostene3
Se dau n
numere naturale. Aflaţi pentru fiecare număr dat x
, câte numere naturale nenule mai mici sau egale cu x
sunt prime cu x
?
NeuroN
Problema | Eratostene3 | Operații I/O |
eratostene3.in /eratostene3.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #36769044 | Utilizator | |
Fișier | eratostene3.cpp | Dimensiune | 477 B |
Data încărcării | 20 Mai 2022, 18:42 | Scor / rezultat | Eroare de compilare |
eratostene3.cpp:6:13: warning: ISO C99 requires whitespace after the macro name [enabled by default] #define nmax=100001 ^ eratostene3.cpp:6:13: error: expected primary-expression before '=' token #define nmax=100001 ^ eratostene3.cpp:9:7: note: in expansion of macro 'nmax' int v[nmax]; ^ eratostene3.cpp: In function 'void ciur(int)': eratostene3.cpp:6:13: error: expected primary-expression before '=' token #define nmax=100001 ^ eratostene3.cpp:13:15: note: in expansion of macro 'nmax' for(i=1;i<nmax;i++)v[i]=i-1; ^ eratostene3.cpp:13:24: error: 'v' was not declared in this scope for(i=1;i<nmax;i++)v[i]=i-1; ^ eratostene3.cpp:14:5: error: 'v' was not declared in this scope v[1]=1; ^ eratostene3.cpp: In function 'int main()': eratostene3.cpp:6:13: error: expected primary-expression before '=' token #define nmax=100001 ^ eratostene3.cpp:22:10: note: in expansion of macro 'nmax' ciur(nmax); ^ eratostene3.cpp:27:12: error: 'v' was not declared in this scope g<<v[x]<<" "; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Eratostene3 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ă.