#3165
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 | #57603655 | Utilizator | |
Fișier | matrdivimp1.cpp | Dimensiune | 531 B |
Data încărcării | 07 Aprilie 2025, 12:25 | Scor / rezultat | Eroare de compilare |
matrdivimp1.cpp: In function 'int IMP(int*, int, int, int)': matrdivimp1.cpp:11:23: error: invalid types 'int[int]' for array subscript return v[i][st]; ^ matrdivimp1.cpp:16:23: error: too few arguments to function 'int IMP(int*, int, int, int)' int s1=IMP(v,st,m); ^ matrdivimp1.cpp:6:5: note: declared here int IMP(int v[],int st,int dr,int i) ^ matrdivimp1.cpp:17:25: error: too few arguments to function 'int IMP(int*, int, int, int)' int s2=IMP(v,m+1,dr); ^ matrdivimp1.cpp:6:5: note: declared here int IMP(int v[],int st,int dr,int i) ^ matrdivimp1.cpp: In function 'int main()': matrdivimp1.cpp:30:13: warning: unused variable 's' [-Wunused-variable] int s=0; ^ matrdivimp1.cpp:31:9: error: 's' was not declared in this scope s=s+IMP(v,1,n,i); ^ matrdivimp1.cpp:31:24: error: cannot convert 'int (*)[101]' to 'int*' for argument '1' to 'int IMP(int*, int, int, int)' s=s+IMP(v,1,n,i); ^ matrdivimp1.cpp: In function 'int IMP(int*, int, int, int)': matrdivimp1.cpp:20: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ă.