#4456
Prime4
Se dă o listă cu n
numere naturale cu trei cifre fiecare. Determinați numărul prim care apare în lista de cele mai multe ori.
Problema | Prime4 | Operații I/O |
prime4.in /prime4.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #55077372 | Utilizator | |
Fișier | prime4.cpp | Dimensiune | 527 B |
Data încărcării | 20 Decembrie 2024, 20:35 | Scor / rezultat | Eroare de compilare |
prime4.cpp:1:20: warning: extra tokens at end of #include directive [enabled by default] #include <iostream>; ^ prime4.cpp:2:19: warning: extra tokens at end of #include directive [enabled by default] #include <fstream>; ^ prime4.cpp: In function 'int main()': prime4.cpp:5:5: error: 'ifstream' was not declared in this scope ifstream cin ("prime4.in"); ^ prime4.cpp:5:5: note: suggested alternative: In file included from /usr/include/c++/4.8/ios:38:0, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from prime4.cpp:1: /usr/include/c++/4.8/iosfwd:157:34: note: 'std::ifstream' typedef basic_ifstream<char> ifstream; ^ prime4.cpp:5:14: error: expected ';' before 'cin' ifstream cin ("prime4.in"); ^ prime4.cpp:6:5: error: 'ofstream' was not declared in this scope ofstream cout ("prime4.out"); ^ prime4.cpp:6:5: note: suggested alternative: In file included from /usr/include/c++/4.8/ios:38:0, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from prime4.cpp:1: /usr/include/c++/4.8/iosfwd:160:34: note: 'std::ofstream' typedef basic_ofstream<char> ofstream; ^ prime4.cpp:6:14: error: expected ';' before 'cout' ofstream cout ("prime4.out"); ^ prime4.cpp:8:5: error: 'cin' was not declared in this scope cin>>n; ^ prime4.cpp:8:5: note: suggested alternative: In file included from prime4.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: 'std::cin' extern istream cin; /// Linked to standard input ^ prime4.cpp:23:5: error: 'cout' was not declared in this scope cout << nrmax; ^ prime4.cpp:23:5: note: suggested alternative: In file included from prime4.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Prime4 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ă.