#1931
Definim un număr ca fiind fantastic dacă numărul de numere la care acesta se împarte exact este un număr prim.
Dându-se un șir cu n
numere întregi strict pozitive, să se afișeze numărul de numere fantastice din șir.
Moisil++, 2016
Problema | Fantastice | Operații I/O |
![]() fantastice.in /fantastice.out
|
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 16 MB
/
Stivă 8 MB
|
Id soluție | #58188550 | Utilizator | |
Fișier | fantastice.cpp | Dimensiune | 472 B |
Data încărcării | 19 Mai 2025, 14:06 | Scor / rezultat | Eroare de compilare |
fantastice.cpp:6:1: error: 'ifstrean' does not name a type ifstrean fin ("fantastice.in"); ^ fantastice.cpp: In function 'int main()': fantastice.cpp:10:5: error: 'in' was not declared in this scope in n,i,contor=0,nrt=0,ok=0; ^ fantastice.cpp:10:8: error: expected ';' before 'n' in n,i,contor=0,nrt=0,ok=0; ^ fantastice.cpp:11:5: error: 'fin' was not declared in this scope fin>>n; ^ fantastice.cpp:11:10: error: 'n' was not declared in this scope fin>>n; ^ fantastice.cpp:13:11: error: 'x' was not declared in this scope {fin>>x; ^ fantastice.cpp:15:10: error: 'i' was not declared in this scope for(i=1;i*i<=k;i++) ^ fantastice.cpp:17:10: error: 'contor' was not declared in this scope contor++; ^ fantastice.cpp:18:14: error: 'i' was not declared in this scope for(i=1;i*i<=contor;i++) ^ fantastice.cpp:18:23: error: 'contor' was not declared in this scope for(i=1;i*i<=contor;i++) ^ fantastice.cpp:19:26: error: 'ok' was not declared in this scope if(contor%i==0){ok=1; break;} ^ fantastice.cpp:20:9: error: 'contor' was not declared in this scope if(contor==0) ^ fantastice.cpp:21:10: error: 'nrt' was not declared in this scope nrt++;} ^ fantastice.cpp:22:11: error: 'nrt' was not declared in this scope fout<<nrt; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Fantastice 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ă.