#3103
Se dă o matrice patratică de latură n. Să se determine CMMDC:
| Problema | MatGCD_rec | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 64 MB
|
| Id soluție | #63900005 | Utilizator | |
| Fișier | matgcd_rec.cpp | Dimensiune | 621 B |
| Data încărcării | 25 Martie 2026, 12:53 | Scor/rezultat | Eroare de compilare |
matgcd_rec.cpp: In function 'int DP(int)': matgcd_rec.cpp:10:10: error: 'n' was not declared in this scope if(i==n) ^ matgcd_rec.cpp:12:15: error: 'x' was not declared in this scope return x[i][i]; ^ matgcd_rec.cpp:15:24: error: 'x' was not declared in this scope return CMMDC(x[i][i], DP(i+1)); ^ matgcd_rec.cpp: In function 'int DS(int)': matgcd_rec.cpp:19:11: error: 'n' was not declared in this scope if(i==n) ^ matgcd_rec.cpp:21:12: error: 'x' was not declared in this scope return x[i][n-i+1] ^ matgcd_rec.cpp:22:5: error: expected ';' before '}' token } ^ matgcd_rec.cpp:24:14: error: 'x' was not declared in this scope return CMMDC(x[i][n-i+1],DS(i+1)); ^ matgcd_rec.cpp: In function 'int CONTUR(int, int)': matgcd_rec.cpp:28:9: error: 'n' was not declared in this scope if(j<=n) ^ matgcd_rec.cpp:30:19: error: 'x' was not declared in this scope return CMMDC(x[1][i],CONTUR(i+1)); ^ matgcd_rec.cpp:30:37: error: too few arguments to function 'int CONTUR(int, int)' return CMMDC(x[1][i],CONTUR(i+1)); ^ matgcd_rec.cpp:26:5: note: declared here int CONTUR(int i, int j) ^ matgcd_rec.cpp:33:1: error: a function-definition is not allowed here before '{' token { ^ matgcd_rec.cpp:41:1: error: expected '}' at end of input } ^ matgcd_rec.cpp: In function 'int DP(int)': matgcd_rec.cpp:16:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ matgcd_rec.cpp: In function 'int DS(int)': matgcd_rec.cpp:25:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ matgcd_rec.cpp: In function 'int CONTUR(int, int)': matgcd_rec.cpp:41:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema MatGCD_rec 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ă.