#187
CifFrecv
Să se scrie un program care citeşte cel mult 1.000.000
de numere naturale din intervalul închis [0,9]
şi determină cel mai mare număr prim citit şi numărul său de apariţii.
Variante Bacalaureat 2009
Problema | CifFrecv | Operații I/O |
![]() ciffrecv.in /ciffrecv.out
|
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 4 MB
/
Stivă 4 MB
|
Id soluție | #51275001 | Utilizator | |
Fișier | ciffrecv.cpp | Dimensiune | 558 B |
Data încărcării | 03 Iunie 2024, 17:58 | Scor / rezultat | Eroare de compilare |
ciffrecv.cpp: In function 'int main()': ciffrecv.cpp:8:13: error: conflicting declaration 'int f [10]' int f[10],i,c; ^ ciffrecv.cpp:6:14: error: 'f' has a previous declaration as 'std::ifstream f' ifstream f("ciffrecv.in"); ^ ciffrecv.cpp:11:10: error: no match for 'operator[]' (operand types are 'std::ifstream {aka std::basic_ifstream<char>}' and 'int') f[i]=0; ^ ciffrecv.cpp:14:10: error: no match for 'operator[]' (operand types are 'std::ifstream {aka std::basic_ifstream<char>}' and 'int') f[c]++; ^ ciffrecv.cpp:19:9: error: no match for 'operator[]' (operand types are 'std::ifstream {aka std::basic_ifstream<char>}' and 'int') if(f[2]>0) ^ ciffrecv.cpp:23:9: error: no match for 'operator[]' (operand types are 'std::ifstream {aka std::basic_ifstream<char>}' and 'int') if(f[3]>0) ^ ciffrecv.cpp:27:9: error: no match for 'operator[]' (operand types are 'std::ifstream {aka std::basic_ifstream<char>}' and 'int') if(f[5]>0) ^ ciffrecv.cpp:31:9: error: no match for 'operator[]' (operand types are 'std::ifstream {aka std::basic_ifstream<char>}' and 'int') if(f[7]>0) ^ ciffrecv.cpp:35:17: error: no match for 'operator[]' (operand types are 'std::ifstream {aka std::basic_ifstream<char>}' and 'int') g<<c<<" "<<f[c]; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema CifFrecv 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ă.