#82
Se cere determinarea maximului şi minimului valorilor dintr-un sir
Problema | MinMax | Operații I/O |
![]() minmax.in /minmax.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #58463508 | Utilizator | |
Fișier | minmax.cpp | Dimensiune | 495 B |
Data încărcării | 07 Iunie 2025, 11:24 | Scor / rezultat | Eroare de compilare |
minmax.cpp: In function 'int main()': minmax.cpp:15:19: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator>' if(min>v[i]) ^ minmax.cpp:18:19: error: the value of 'v' is not usable in a constant expression if(max<v[i]) ^ minmax.cpp:9:9: note: 'v' was not declared 'constexpr' int v[1000], n, i, minim=INT_MAX, maxim=INT_MIN; ^ minmax.cpp:18:12: error: parse error in template argument list if(max<v[i]) ^ minmax.cpp:18:20: error: cannot resolve overloaded function 'max' based on conversion to type 'bool' if(max<v[i]) ^ minmax.cpp:22:24: error: no matching function for call to 'std::basic_ifstream<char>::close(const char [10])' f.close("minmax.in"); ^ minmax.cpp:22:24: note: candidate is: In file included from minmax.cpp:3:0: /usr/include/c++/4.8/fstream:576:7: note: void std::basic_ifstream<_CharT, _Traits>::close() [with _CharT = char; _Traits = std::char_traits<char>] close() ^ /usr/include/c++/4.8/fstream:576:7: note: candidate expects 0 arguments, 1 provided minmax.cpp:23:25: error: no matching function for call to 'std::basic_ofstream<char>::close(const char [11])' g.close("minmax.out"); ^ minmax.cpp:23:25: note: candidate is: In file included from minmax.cpp:3:0: /usr/include/c++/4.8/fstream:753:7: note: void std::basic_ofstream<_CharT, _Traits>::close() [with _CharT = char; _Traits = std::char_traits<char>] close() ^ /usr/include/c++/4.8/fstream:753:7: note: candidate expects 0 arguments, 1 provided
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema MinMax 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ă.