#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 | #52280758 | Utilizator | |
Fișier | ciffrecv.cpp | Dimensiune | 441 B |
Data încărcării | 25 Septembrie 2024, 12:40 | Scor / rezultat | Eroare de compilare |
ciffrecv.cpp: In function 'int main()': ciffrecv.cpp:9:11: error: reference to 'cin' is ambiguous while(cin >> x){ ^ ciffrecv.cpp:3:10: note: candidates are: std::ifstream cin ifstream cin("ciffrecv.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from ciffrecv.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ ciffrecv.cpp:13:9: error: reference to 'cout' is ambiguous cout<<7<< ' ' <<v[7]; ^ ciffrecv.cpp:4:10: note: candidates are: std::ofstream cout ofstream cout("ciffrecv.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from ciffrecv.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ ciffrecv.cpp:16:9: error: reference to 'cout' is ambiguous cout<<5<< ' ' <<v[5]; ^ ciffrecv.cpp:4:10: note: candidates are: std::ofstream cout ofstream cout("ciffrecv.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from ciffrecv.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ ciffrecv.cpp:19:9: error: reference to 'cout' is ambiguous cout<<3<< ' ' <<v[3]; ^ ciffrecv.cpp:4:10: note: candidates are: std::ofstream cout ofstream cout("ciffrecv.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from ciffrecv.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ ciffrecv.cpp:22:9: error: reference to 'cout' is ambiguous cout<<2<< ' ' <<v[2]; ^ ciffrecv.cpp:4:10: note: candidates are: std::ofstream cout ofstream cout("ciffrecv.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from ciffrecv.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^
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ă.