#8
maxim3
Să se scrie un program care determină maximul a trei numere întregi citite dintr-un fişier.
Problema | maxim3 | Operații I/O |
maxim3.in /maxim3.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #51382679 | Utilizator | |
Fișier | maxim3.cpp | Dimensiune | 364 B |
Data încărcării | 11 Iunie 2024, 19:39 | Scor / rezultat | Eroare de compilare |
maxim3.cpp: In function 'int main()': maxim3.cpp:10:27: error: no matching function for call to 'std::basic_ifstream<char>::basic_ifstream(const openmode&)' ifstream in (maxim3.in); ^ maxim3.cpp:10:27: note: candidates are: In file included from maxim3.cpp:2:0: /usr/include/c++/4.8/fstream:483:7: note: std::basic_ifstream<_CharT, _Traits>::basic_ifstream(const string&, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::string = std::basic_string<char>; std::ios_base::openmode = std::_Ios_Openmode] basic_ifstream(const std::string& __s, ^ /usr/include/c++/4.8/fstream:483:7: note: no known conversion for argument 1 from 'const openmode {aka const std::_Ios_Openmode}' to 'const string& {aka const std::basic_string<char>&}' /usr/include/c++/4.8/fstream:467:7: note: std::basic_ifstream<_CharT, _Traits>::basic_ifstream(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::_Ios_Openmode] basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in) ^ /usr/include/c++/4.8/fstream:467:7: note: no known conversion for argument 1 from 'const openmode {aka const std::_Ios_Openmode}' to 'const char*' /usr/include/c++/4.8/fstream:453:7: note: std::basic_ifstream<_CharT, _Traits>::basic_ifstream() [with _CharT = char; _Traits = std::char_traits<char>] basic_ifstream() : __istream_type(), _M_filebuf() ^ /usr/include/c++/4.8/fstream:453:7: note: candidate expects 0 arguments, 1 provided maxim3.cpp:11:29: error: no matching function for call to 'std::basic_ofstream<char>::basic_ofstream(const openmode&)' ofstream out (maxim3.out); ^ maxim3.cpp:11:29: note: candidates are: In file included from maxim3.cpp:2:0: /usr/include/c++/4.8/fstream:658:7: note: std::basic_ofstream<_CharT, _Traits>::basic_ofstream(const string&, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::string = std::basic_string<char>; std::ios_base::openmode = std::_Ios_Openmode] basic_ofstream(const std::string& __s, ^ /usr/include/c++/4.8/fstream:658:7: note: no known conversion for argument 1 from 'const openmode {aka const std::_Ios_Openmode}' to 'const string& {aka const std::basic_string<char>&}' /usr/include/c++/4.8/fstream:640:7: note: std::basic_ofstream<_CharT, _Traits>::basic_ofstream(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::_Ios_Openmode] basic_ofstream(const char* __s, ^ /usr/include/c++/4.8/fstream:640:7: note: no known conversion for argument 1 from 'const openmode {aka const std::_Ios_Openmode}' to 'const char*' /usr/include/c++/4.8/fstream:625:7: note: std::basic_ofstream<_CharT, _Traits>::basic_ofstream() [with _CharT = char; _Traits = std::char_traits<char>] basic_ofstream(): __ostream_type(), _M_filebuf() ^ /usr/include/c++/4.8/fstream:625:7: note: candidate expects 0 arguments, 1 provided
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema maxim3 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ă.