#354
n_maxim
Se dau n
numere întregi. Calculaţi cel mai mare dintre cele n
numere date.
Problema | n_maxim | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #48003618 | Utilizator | |
Fișier | n_maxim.cpp | Dimensiune | 205 B |
Data încărcării | 12 Ianuarie 2024, 13:59 | Scor / rezultat | Eroare de compilare |
n_maxim.cpp: In function 'int main()': n_maxim.cpp:8:8: error: expected '(' before '{' token for{int x=1; x<=n; x++}{ ^ n_maxim.cpp:8:8: error: expected primary-expression before '{' token n_maxim.cpp:8:8: error: expected ';' before '{' token n_maxim.cpp:8:28: error: expected primary-expression before '{' token for{int x=1; x<=n; x++}{ ^ n_maxim.cpp:8:28: error: expected ';' before '{' token n_maxim.cpp:8:28: error: expected primary-expression before '{' token n_maxim.cpp:8:28: error: expected ')' before '{' token n_maxim.cpp:10:11: error: reference to 'max' is ambiguous if(nr>max) max=nr; ^ n_maxim.cpp:4:16: note: candidates are: int max int n=0, nr=0, max=0; ^ 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/ostream:38, from /usr/include/c++/4.8/iostream:39, from n_maxim.cpp:1: /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:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^ n_maxim.cpp:10:16: error: reference to 'max' is ambiguous if(nr>max) max=nr; ^ n_maxim.cpp:4:16: note: candidates are: int max int n=0, nr=0, max=0; ^ 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/ostream:38, from /usr/include/c++/4.8/iostream:39, from n_maxim.cpp:1: /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:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^ n_maxim.cpp:12:11: error: reference to 'max' is ambiguous cout<<max; ^ n_maxim.cpp:4:16: note: candidates are: int max int n=0, nr=0, max=0; ^ 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/ostream:38, from /usr/include/c++/4.8/iostream:39, from n_maxim.cpp:1: /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:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema n_maxim 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ă.