#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 | #58066407 | Utilizator | |
Fișier | maxim3.cpp | Dimensiune | 218 B |
Data încărcării | 12 Mai 2025, 13:54 | Scor / rezultat | Eroare de compilare |
maxim3.cpp:5:1: error: 'ofstrem' does not name a type ofstrem fout("maxim3.out"); ^ maxim3.cpp: In function 'int main()': maxim3.cpp:13:19: error: no matching function for call to 'max(int&, <unresolved overloaded function type>)' max1=max(a,max); ^ maxim3.cpp:13:19: note: candidates are: In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from maxim3.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: const _Tp& std::max(const _Tp&, const _Tp&) [with _Tp = int] max(const _Tp& __a, const _Tp& __b) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: no known conversion for argument 2 from '<unresolved overloaded function type>' to 'const int&' /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template argument deduction/substitution failed: maxim3.cpp:13:19: note: candidate expects 3 arguments, 2 provided max1=max(a,max); ^ maxim3.cpp:14:5: error: 'fout' was not declared in this scope fout<<max1; ^
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ă.