#192
SumColMax
Să se afișeze elementele de pe coloana cu suma elementelor maximă într-o matrice.
Problema | SumColMax | Operații I/O |
sumcolmax.in /sumcolmax.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54817016 | Utilizator | |
Fișier | sumcolmax.cpp | Dimensiune | 366 B |
Data încărcării | 09 Decembrie 2024, 15:44 | Scor / rezultat | Eroare de compilare |
sumcolmax.cpp: In function 'int main()': sumcolmax.cpp:7:9: error: 'i' was not declared in this scope for(i=0;i<=n;i++) ^ sumcolmax.cpp:8:9: error: 'j' was not declared in this scope for(j=0;j<=m;j++)cin>>a[i][j]; ^ sumcolmax.cpp:9:13: error: 'i' was not declared in this scope for(i=0;i<=n;i++) ^ sumcolmax.cpp:10:9: error: 'j' was not declared in this scope for(j=0;j<=m;j++) ^ sumcolmax.cpp:13:10: error: reference to 'max' is ambiguous if(S>max){ ^ sumcolmax.cpp:3:25: note: candidates are: int max int n,m,S=0,a[100][100],max=-1; ^ 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 sumcolmax.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) ^ sumcolmax.cpp:14:9: error: reference to 'max' is ambiguous max=S; ^ sumcolmax.cpp:3:25: note: candidates are: int max int n,m,S=0,a[100][100],max=-1; ^ 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 sumcolmax.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) ^ sumcolmax.cpp:17:9: error: 'i' was not declared in this scope for(i=0;i<=n;i++) ^ sumcolmax.cpp:18:16: error: 'j' was not declared in this scope cout<<a[i][j];<<" "; ^ sumcolmax.cpp:18:19: error: expected primary-expression before '<<' token cout<<a[i][j];<<" "; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema SumColMax 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ă.