#2269
MaximPar
Se dau n numere naturale. Determinați cel mai mare număr par introdus și numărul său de apariții.
Problema | MaximPar | Operații I/O |
maximpar.in /maximpar.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #49303544 | Utilizator | |
Fișier | maximpar.cpp | Dimensiune | 404 B |
Data încărcării | 25 Februarie 2024, 13:25 | Scor / rezultat | Eroare de compilare |
maximpar.cpp: In function 'int main()': maximpar.cpp:4:2: error: 'ifstream' was not declared in this scope {ifstream fin("maximpar.in"); ^ maximpar.cpp:4:2: 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 maximpar.cpp:1: /usr/include/c++/4.8/iosfwd:157:34: note: 'std::ifstream' typedef basic_ifstream<char> ifstream; ^ maximpar.cpp:4:11: error: expected ';' before 'fin' {ifstream fin("maximpar.in"); ^ maximpar.cpp:5:2: error: 'ofstream' was not declared in this scope ofstream fout("maximpar.out"); ^ maximpar.cpp:5:2: 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 maximpar.cpp:1: /usr/include/c++/4.8/iosfwd:160:34: note: 'std::ofstream' typedef basic_ofstream<char> ofstream; ^ maximpar.cpp:5:11: error: expected ';' before 'fout' ofstream fout("maximpar.out"); ^ maximpar.cpp:7:1: error: 'cin' was not declared in this scope cin>>n; ^ maximpar.cpp:7:1: note: suggested alternative: In file included from maximpar.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: 'std::cin' extern istream cin; /// Linked to standard input ^ maximpar.cpp:22:1: error: 'cout' was not declared in this scope cout<<maxi<<" "<<ap; ^ maximpar.cpp:22:1: note: suggested alternative: In file included from maximpar.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ maximpar.cpp:23:2: error: 'fin' was not declared in this scope fin.close(); ^ maximpar.cpp:24:2: error: 'fout' was not declared in this scope fout.close(); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema MaximPar 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ă.