#778
Se dă o matrice cu n linii şi m coloane şi elemente numere naturale. Să se determine mulțimea formată din elementele distincte ale chenarului matricei.
| Problema | MChenar | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64867632 | Utilizator | |
| Fișier | mchenar.cpp | Dimensiune | 629 B |
| Data încărcării | 08 Iunie 2026, 14:45 | Scor/rezultat | Eroare de compilare |
mchenar.cpp: In function ‘int main()’: mchenar.cpp:7:10: error: ‘n’ was not declared in this scope 7 | cin >> n >> m; | ^ mchenar.cpp:7:15: error: ‘m’ was not declared in this scope; did you mean ‘tm’? 7 | cin >> n >> m; | ^ | tm mchenar.cpp:10:16: error: ‘a’ was not declared in this scope 10 | cin >> a[i][j]; | ^ mchenar.cpp:8:3: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 8 | for(int i = 1; i <= n; i++) | ^~~ mchenar.cpp:12:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 12 | int k = 1; | ^~~ mchenar.cpp:14:9: error: ‘v’ was not declared in this scope 14 | v[k++] = a[1][j]; | ^ mchenar.cpp:14:18: error: ‘a’ was not declared in this scope 14 | v[k++] = a[1][j]; | ^ mchenar.cpp:17:9: error: ‘v’ was not declared in this scope 17 | v[k++] = a[i][m]; | ^ mchenar.cpp:17:18: error: ‘a’ was not declared in this scope 17 | v[k++] = a[i][m]; | ^ mchenar.cpp:20:9: error: ‘v’ was not declared in this scope 20 | v[k++] = a[n][j]; | ^ mchenar.cpp:20:18: error: ‘a’ was not declared in this scope 20 | v[k++] = a[n][j]; | ^ mchenar.cpp:23:9: error: ‘v’ was not declared in this scope 23 | v[k++] = a[i][1]; | ^ mchenar.cpp:23:18: error: ‘a’ was not declared in this scope 23 | v[k++] = a[i][1]; | ^ mchenar.cpp:27:12: error: ‘v’ was not declared in this scope 27 | if(v[i] > v[i + 1]) | ^ mchenar.cpp:29:17: warning: unused variable ‘aux’ [-Wunused-variable] 29 | int aux = v[i]; | ^~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema MChenar 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ă.