#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 | #54445878 | Utilizator | |
Fișier | n_maxim.cpp | Dimensiune | 203 B |
Data încărcării | 28 Noiembrie 2024, 16:51 | Scor / rezultat | Eroare de compilare |
n_maxim.cpp: In function 'int main()': n_maxim.cpp:8:11: warning: right operand of comma operator has no effect [-Wunused-value] for(i=0,i<n,i++) ^ n_maxim.cpp:8:17: error: expected ';' before ')' token for(i=0,i<n,i++) ^ n_maxim.cpp:10:2: error: expected primary-expression before 'if' if(nr>max) ^ n_maxim.cpp:10:2: error: expected ';' before 'if' n_maxim.cpp:10:2: error: expected primary-expression before 'if' n_maxim.cpp:10:2: error: expected ')' before 'if' n_maxim.cpp:10:8: error: reference to 'max' is ambiguous if(nr>max) ^ n_maxim.cpp:4:7: note: candidates are: int max int n,max,i,nr; ^ 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:11:6: error: reference to 'max' is ambiguous max=nr; ^ n_maxim.cpp:4:7: note: candidates are: int max int n,max,i,nr; ^ 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:8: error: reference to 'max' is ambiguous cout<<max<<endl; ^ n_maxim.cpp:4:7: note: candidates are: int max int n,max,i,nr; ^ 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ă.