#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 | #64861329 | Utilizator | |
| Fișier | matgcd_rec.cpp | Dimensiune | 368 B |
| Data încărcării | 08 Iunie 2026, 09:18 | Scor/rezultat | Eroare de compilare |
matgcd_rec.cpp: In function ‘int main()’: matgcd_rec.cpp:4:8: error: declaration of ‘a’ as multidimensional array must have bounds for all dimensions except the first 4 | {int n,a[][]; | ^ matgcd_rec.cpp:8:16: error: ‘b’ was not declared in this scope 8 | {while(b!=0) | ^ matgcd_rec.cpp:9:19: error: ‘a’ was not declared in this scope 9 | int r=a%b; | ^ matgcd_rec.cpp:8:10: warning: this ‘while’ clause does not guard... [-Wmisleading-indentation] 8 | {while(b!=0) | ^~~~~ matgcd_rec.cpp:10:13: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘while’ 10 | a=b; | ^ matgcd_rec.cpp:9:17: warning: unused variable ‘r’ [-Wunused-variable] 9 | int r=a%b; | ^ matgcd_rec.cpp:10:13: error: ‘a’ was not declared in this scope 10 | a=b; | ^ matgcd_rec.cpp:10:15: error: ‘b’ was not declared in this scope 10 | a=b; | ^ matgcd_rec.cpp:11:15: error: ‘r’ was not declared in this scope 11 | b=r; | ^ matgcd_rec.cpp:5:1: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 5 | for(int i=1;i<=n;i++) | ^~~ matgcd_rec.cpp:13:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 13 | if(i+j==n+1) | ^~ matgcd_rec.cpp:13:8: error: ‘i’ was not declared in this scope 13 | if(i+j==n+1) | ^ matgcd_rec.cpp:13:10: error: ‘j’ was not declared in this scope 13 | if(i+j==n+1) | ^ matgcd_rec.cpp:14:16: error: ‘b’ was not declared in this scope 14 | {while(b!=0) | ^ matgcd_rec.cpp:15:19: error: ‘a’ was not declared in this scope 15 | int r=a%b; | ^ matgcd_rec.cpp:14:10: warning: this ‘while’ clause does not guard... [-Wmisleading-indentation] 14 | {while(b!=0) | ^~~~~ matgcd_rec.cpp:16:13: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘while’ 16 | a=b; | ^ matgcd_rec.cpp:15:17: warning: unused variable ‘r’ [-Wunused-variable] 15 | int r=a%b; | ^ matgcd_rec.cpp:16:13: error: ‘a’ was not declared in this scope 16 | a=b; | ^ matgcd_rec.cpp:16:15: error: ‘b’ was not declared in this scope 16 | a=b; | ^ matgcd_rec.cpp:17:15: error: ‘r’ was not declared in this scope 17 | b=r; | ^
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ă.