#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 | #64558062 | Utilizator | |
| Fișier | simetrica_bac.cpp | Dimensiune | 407 B |
| Data încărcării | 14 Mai 2026, 10:50 | 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:11:17: error: expected unqualified-id before ‘=’ token 11 | for(int =1;j<=m/2;j++) | ^ simetrica_bac.cpp:11:16: error: expected ‘;’ before ‘=’ token 11 | for(int =1;j<=m/2;j++) | ^~ | ; simetrica_bac.cpp:11:17: error: expected primary-expression before ‘=’ token 11 | for(int =1;j<=m/2;j++) | ^ simetrica_bac.cpp:11:21: warning: for increment expression has no effect [-Wunused-value] 11 | for(int =1;j<=m/2;j++) | ~^~~~~ simetrica_bac.cpp:11:26: error: expected ‘)’ before ‘;’ token 11 | for(int =1;j<=m/2;j++) | ~ ^ | ) simetrica_bac.cpp:11:9: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 11 | for(int =1;j<=m/2;j++) | ^~~ simetrica_bac.cpp:11:27: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 11 | for(int =1;j<=m/2;j++) | ^ simetrica_bac.cpp:10:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 10 | for(int i=1;i<=n;i++) | ^~~ simetrica_bac.cpp:11:27: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 11 | for(int =1;j<=m/2;j++) | ^ simetrica_bac.cpp:11:30: error: expected ‘;’ before ‘)’ token 11 | for(int =1;j<=m/2;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ă.