#3120
Un tablou bidimensional cu număr impar de coloane este numit simetric faţă de coloana din mijloc dacă, pe fiecare linie a tabloului, elementele dispuse simetric faţă de elementul din mijloc al liniei respective au valori egale.
Scrieţi un program care citește de la tastatură două numere naturale, m și n (n impar), și elementele unui tablou bidimensional cu m linii și n coloane, numere naturale. Programul afișează pe ecran mesajul DA, dacă tabloul este simetric față de coloana din mijloc, sau mesajul NU în caz contrar.
| Problema | Simetrica_Bac | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64558077 | Utilizator | |
| Fișier | simetrica_bac.cpp | Dimensiune | 408 B |
| Data încărcării | 14 Mai 2026, 10:51 | Scor/rezultat | Eroare de compilare |
simetrica_bac.cpp: In function ‘int main()’: simetrica_bac.cpp:8:17: error: expected unqualified-id before ‘=’ token 8 | for(int =1;j<=m;j++) | ^ simetrica_bac.cpp:8:16: error: expected ‘;’ before ‘=’ token 8 | for(int =1;j<=m;j++) | ^~ | ; simetrica_bac.cpp:8:17: error: expected primary-expression before ‘=’ token 8 | for(int =1;j<=m;j++) | ^ simetrica_bac.cpp:8:21: warning: for increment expression has no effect [-Wunused-value] 8 | for(int =1;j<=m;j++) | ~^~~ simetrica_bac.cpp:8:24: error: expected ‘)’ before ‘;’ token 8 | for(int =1;j<=m;j++) | ~ ^ | ) simetrica_bac.cpp:8:9: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 8 | for(int =1;j<=m;j++) | ^~~ simetrica_bac.cpp:8:25: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 8 | for(int =1;j<=m;j++) | ^ simetrica_bac.cpp:7:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 7 | for(int i=1;i<=n;i++) | ^~~ simetrica_bac.cpp:8:25: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 8 | for(int =1;j<=m;j++) | ^ simetrica_bac.cpp:8:28: error: expected ‘;’ before ‘)’ token 8 | for(int =1;j<=m;j++) | ^ | ; simetrica_bac.cpp:12:20: warning: init-statement in selection statements only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions] 12 | if(a[i][j]!=a[i][n+1-j] | ^ simetrica_bac.cpp:12:40: error: expected ‘;’ before ‘{’ token 12 | if(a[i][j]!=a[i][n+1-j] | ^ | ; 13 | { | ~ simetrica_bac.cpp:12:27: warning: statement has no effect [-Wunused-value] 12 | if(a[i][j]!=a[i][n+1-j] | ~~~~~~~^~~~~~~~~~~~~ simetrica_bac.cpp:17:15: error: expected ‘)’ before ‘;’ token 17 | cout<<"DA"; | ^ | ) simetrica_bac.cpp:12:19: note: to match this ‘(’ 12 | if(a[i][j]!=a[i][n+1-j] | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Simetrica_Bac 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ă.