#787
Se dă o matrice cu n linii şi n coloane şi elemente numere naturale. Să se construiască o matrice care să fie simetrica față de diagonala secundară a matricei date.
| Problema | MatSim1 | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64814928 | Utilizator | |
| Fișier | matsim1.cpp | Dimensiune | 362 B |
| Data încărcării | 03 Iunie 2026, 09:40 | Scor/rezultat | Eroare de compilare |
matsim1.cpp: In function ‘int main()’: matsim1.cpp:7:9: error: ‘n’ was not declared in this scope 7 | cin>>n; | ^ matsim1.cpp:8:8: error: ‘i’ was not declared in this scope 8 | for(i=1;i<=n,i++) | ^ matsim1.cpp:8:20: error: expected ‘;’ before ‘)’ token 8 | for(i=1;i<=n,i++) | ^ | ; matsim1.cpp:9:9: error: ‘j’ was not declared in this scope 9 | for(j=i;j<=n;j++) | ^ matsim1.cpp:10:9: error: ‘a’ was not declared in this scope 10 | cin>>a[i][j]; | ^ matsim1.cpp:11:8: error: ‘i’ was not declared in this scope 11 | for(i=1;i<=n,i++) | ^ matsim1.cpp:11:20: error: expected ‘;’ before ‘)’ token 11 | for(i=1;i<=n,i++) | ^ | ; matsim1.cpp:12:9: error: ‘j’ was not declared in this scope 12 | for(j=1;j<=n-1;j++) | ^ matsim1.cpp:13:4: error: ‘aux’ was not declared in this scope 13 | aux=a[i][j] | ^~~ matsim1.cpp:13:8: error: ‘a’ was not declared in this scope 13 | aux=a[i][j] | ^ matsim1.cpp:15:4: error: ‘a’ was not declared in this scope 15 | a[n-j+1][n-i+j=aux; | ^ matsim1.cpp:15:8: error: ‘j’ was not declared in this scope 15 | a[n-j+1][n-i+j=aux; | ^ matsim1.cpp:15:15: error: ‘i’ was not declared in this scope 15 | a[n-j+1][n-i+j=aux; | ^ matsim1.cpp:15:19: error: ‘aux’ was not declared in this scope 15 | a[n-j+1][n-i+j=aux; | ^~~ matsim1.cpp:15:22: error: expected ‘]’ before ‘;’ token 15 | a[n-j+1][n-i+j=aux; | ^ | ] matsim1.cpp:19:8: error: expected ‘;’ before ‘endl’ 19 | cout endl; | ^~~~~ | ; matsim1.cpp:19:4: warning: statement has no effect [-Wunused-value] 19 | cout endl; | ^~~~ matsim1.cpp: At global scope: matsim1.cpp:23:1: error: expected unqualified-id before ‘return’ 23 | return o; | ^~~~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema MatSim1 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ă.