#3165
MatrDivImp1
Se consideră o matrice cu m
linii și n
coloane, numere naturale. Folosind metoda Divide et Impera, determinați suma numerelor pare din matrice.
Problema | MatrDivImp1 | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #29407716 | Utilizator | |
Fișier | matrdivimp1.cpp | Dimensiune | 558 B |
Data încărcării | 25 Aprilie 2021, 15:52 | Scor / rezultat | Eroare de compilare |
matrdivimp1.cpp: In function 'int Sum(unsigned int*, unsigned int, unsigned int)': matrdivimp1.cpp:17:27: error: invalid conversion from 'unsigned int' to 'unsigned int*' [-fpermissive] return Sum(st ,mij) + Sum( mij + 1 , dr); ^ matrdivimp1.cpp:17:27: error: too few arguments to function 'int Sum(unsigned int*, unsigned int, unsigned int)' matrdivimp1.cpp:7:5: note: declared here int Sum(unsigned int v[101],unsigned int st,unsigned int dr) ^ matrdivimp1.cpp:17:40: error: invalid conversion from 'int' to 'unsigned int*' [-fpermissive] return Sum(st ,mij) + Sum( mij + 1 , dr); ^ matrdivimp1.cpp:17:48: error: too few arguments to function 'int Sum(unsigned int*, unsigned int, unsigned int)' return Sum(st ,mij) + Sum( mij + 1 , dr); ^ matrdivimp1.cpp:7:5: note: declared here int Sum(unsigned int v[101],unsigned int st,unsigned int dr) ^ matrdivimp1.cpp: In function 'int main()': matrdivimp1.cpp:22:11: error: cannot bind 'std::istream {aka std::basic_istream<char>}' lvalue to 'std::basic_istream<char>&&' cin >>m>>n; ^ In file included from /usr/include/c++/4.8/iostream:40:0, from matrdivimp1.cpp:1: /usr/include/c++/4.8/istream:872:5: error: initializing argument 1 of 'std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&&, _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Tp = unsigned int [101][101]]' operator>>(basic_istream<_CharT, _Traits>&& __is, _Tp& __x) ^ matrdivimp1.cpp:23:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] for(i = 1; i <=m ; i ++) ^ matrdivimp1.cpp:24:13: error: 'j' was not declared in this scope for(j=1;j<=n;j++) ^ matrdivimp1.cpp:26:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] for(i=1;i<=m;i++) ^ matrdivimp1.cpp: In function 'int Sum(unsigned int*, unsigned int, unsigned int)': matrdivimp1.cpp:19:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema MatrDivImp1 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ă.