#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 | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #21235105 | Utilizator | |
Fișier | matrdivimp1.cpp | Dimensiune | 586 B |
Data încărcării | 24 Februarie 2020, 14:44 | Scor / rezultat | Eroare de compilare |
matrdivimp1.cpp:6:51: error: declaration of 'a' as multidimensional array must have bounds for all dimensions except the first int mat(int st, int dr, int sus, int jos ,int a[][]){ ^ matrdivimp1.cpp: In function 'int mat(...)': matrdivimp1.cpp:7:9: error: 'st' was not declared in this scope if (st==dr&&sus==jos) ^ matrdivimp1.cpp:7:13: error: 'dr' was not declared in this scope if (st==dr&&sus==jos) ^ matrdivimp1.cpp:7:17: error: 'sus' was not declared in this scope if (st==dr&&sus==jos) ^ matrdivimp1.cpp:7:22: error: 'jos' was not declared in this scope if (st==dr&&sus==jos) ^ matrdivimp1.cpp:8:14: error: 'a' was not declared in this scope {if (a[sus][dr]%2==1) ^ matrdivimp1.cpp:14:9: error: expected initializer before 'm1' m1=(st+dr)/2; ^ matrdivimp1.cpp:15:9: error: 'm2' was not declared in this scope m2=(sus+jos)/2; ^ matrdivimp1.cpp:16:25: error: 'a' was not declared in this scope j1=mat(st,m1,sus,m2,a) ^ matrdivimp1.cpp:17:5: error: expected ';' before 'j2' j2=mat(m1+1,dr,m2+2,jos,a) ^ matrdivimp1.cpp: In function 'int main()': matrdivimp1.cpp:30:5: error: 'b' was not declared in this scope b=mat(1,n,1,m,a) ^ matrdivimp1.cpp:32:1: error: expected ';' before '}' token } ^ matrdivimp1.cpp: In function 'int mat(...)': matrdivimp1.cpp:19:2: 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ă.