#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 | #64625635 | Utilizator | |
| Fișier | mchenar.cpp | Dimensiune | 477 B |
| Data încărcării | 19 Mai 2026, 10:42 | Scor/rezultat | Eroare de compilare |
mchenar.cpp: In function ‘int main()’: mchenar.cpp:4:33: error: expected ‘,’ or ‘;’ before ‘=’ token 4 | {int v[101][101]={0},vf{1000000}={0},max=0,n,m; | ^ mchenar.cpp:4:37: error: expected primary-expression before ‘,’ token 4 | {int v[101][101]={0},vf{1000000}={0},max=0,n,m; | ^ mchenar.cpp:4:42: error: overloaded function with no contextual type information 4 | {int v[101][101]={0},vf{1000000}={0},max=0,n,m; | ^ mchenar.cpp:4:44: error: ‘n’ was not declared in this scope 4 | {int v[101][101]={0},vf{1000000}={0},max=0,n,m; | ^ mchenar.cpp:4:46: error: ‘m’ was not declared in this scope 4 | {int v[101][101]={0},vf{1000000}={0},max=0,n,m; | ^ mchenar.cpp:8:40: error: invalid operands of types ‘int’ and ‘<unresolved overloaded function type>’ to binary ‘operator>’ 8 | if (v[i][j]>max) max=v[i][j]; | ~~~~~~~^~~~ mchenar.cpp:8:56: error: overloaded function with no contextual type information 8 | if (v[i][j]>max) max=v[i][j]; | ^ mchenar.cpp:9:27: error: invalid types ‘int[int]’ for array subscript 9 | for (int j=1;j<=m;j++) {vf[v[1][j]]++; | ^ mchenar.cpp:12:25: error: invalid types ‘int[int]’ for array subscript 12 | for (int i=2;i<n;i++){vf[v[i][1]]++; | ^ mchenar.cpp:15:15: error: invalid operands of types ‘int’ and ‘<unresolved overloaded function type>’ to binary ‘operator<=’ 15 | for (int i=1;i<=max;i++) if (vf[i]<=1) cout<<vf[i]<<' '; | ~^~~~~ mchenar.cpp:15:32: error: invalid types ‘int[int]’ for array subscript 15 | for (int i=1;i<=max;i++) if (vf[i]<=1) cout<<vf[i]<<' '; | ^ mchenar.cpp:15:48: error: invalid types ‘int[int]’ for array subscript 15 | for (int i=1;i<=max;i++) if (vf[i]<=1) cout<<vf[i]<<' '; | ^ mchenar.cpp:17:2: error: expected ‘}’ at end of input 17 | } | ^ mchenar.cpp:4:1: note: to match this ‘{’ 4 | {int v[101][101]={0},vf{1000000}={0},max=0,n,m; | ^
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ă.