#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 |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64289474 | Utilizator | |
| Fișier | matrdivimp1.cpp | Dimensiune | 676 B |
| Data încărcării | 28 Aprilie 2026, 10:31 | Scor/rezultat | Eroare de compilare |
matrdivimp1.cpp: In function ‘int divImp(int (*)[100], int, int, int)’: matrdivimp1.cpp:16:27: error: invalid conversion from ‘int’ to ‘int (*)[101]’ [-fpermissive] 16 | return calculSuma(st); | ^~ | | | int matrdivimp1.cpp:16:26: error: too few arguments to function ‘int calculSuma(int (*)[101], int, int)’ 16 | return calculSuma(st); | ~~~~~~~~~~^~~~ matrdivimp1.cpp:4:5: note: declared here 4 | int calculSuma(int M[][101], int linie, int n) | ^~~~~~~~~~ matrdivimp1.cpp:20:38: warning: pointer to a function used in arithmetic [-Wpointer-arith] 20 | return divImp(M, st, mij, n) + divImp; | ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~ matrdivimp1.cpp:20:38: error: invalid conversion from ‘int (*)(int (*)[100], int, int, int)’ to ‘int’ [-fpermissive] 20 | return divImp(M, st, mij, n) + divImp; | ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~ | | | int (*)(int (*)[100], int, int, int) matrdivimp1.cpp: In function ‘int main()’: matrdivimp1.cpp:32:20: error: cannot convert ‘int (*)[101]’ to ‘int (*)[100]’ 32 | cout << divImp(M, 0, m - 1, n); | ^ | | | int (*)[101] matrdivimp1.cpp:13:16: note: initializing argument 1 of ‘int divImp(int (*)[100], int, int, int)’ 13 | int divImp(int M[][100], int st, int dr, int n) | ~~~~^~~~~~~~
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ă.