#4254
Matrice12
Scrieți un program care citește de la tastatură două numere naturale din intervalul [2,50]
, n
și m
, și elementele unei matrici cu n
linii și m
coloane, numere naturale distincte din intervalul [0,10
4
]
.
Programul interschimbă elementele de pe coloana pe care se află valoarea minimă cu elementele de pe coloana pe care se află valoarea maximă din matrice, apoi pe ecran matricea modificată, câte o linie a matricii pe câte o linie a ecranului, elementele fiecărei linii fiind separate prin câte un spațiu.
Problema | Matrice12 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #52774746 | Utilizator | |
Fișier | matrice12.cpp | Dimensiune | 988 B |
Data încărcării | 09 Octombrie 2024, 09:41 | Scor / rezultat | Eroare de compilare |
matrice12.cpp:1:37: error: declaration of 'a' as multidimensional array must have bounds for all dimensions except the first void citire(int &n, int &m, int a[][]) ^ matrice12.cpp: In function 'void citire(...)': matrice12.cpp:3:5: error: 'cin' was not declared in this scope cin>>n>>m; ^ matrice12.cpp:3:10: error: 'n' was not declared in this scope cin>>n>>m; ^ matrice12.cpp:3:13: error: 'm' was not declared in this scope cin>>n>>m; ^ matrice12.cpp:6:18: error: 'a' was not declared in this scope cin>>a[i][j]; ^ matrice12.cpp: At global scope: matrice12.cpp:8:49: error: declaration of 'a' as multidimensional array must have bounds for all dimensions except the first void afisare(int i, int j,int n, int m, int a[][]) ^ matrice12.cpp: In function 'void afisare(...)': matrice12.cpp:10:9: error: 'i' was not declared in this scope for(i=1; i<=n; i++) ^ matrice12.cpp:10:17: error: 'n' was not declared in this scope for(i=1; i<=n; i++) ^ matrice12.cpp:12:13: error: 'j' was not declared in this scope for(j=1; j<=m; j++) ^ matrice12.cpp:12:21: error: 'm' was not declared in this scope for(j=1; j<=m; j++) ^ matrice12.cpp:13:13: error: 'cout' was not declared in this scope cout<<a[i][j]<<" "; ^ matrice12.cpp:13:19: error: 'a' was not declared in this scope cout<<a[i][j]<<" "; ^ matrice12.cpp:14:9: error: 'cout' was not declared in this scope cout<<endl; //cout<<'\n'; ^ matrice12.cpp:14:15: error: 'endl' was not declared in this scope cout<<endl; //cout<<'\n'; ^ matrice12.cpp: At global scope: matrice12.cpp:17:48: error: declaration of 'a' as multidimensional array must have bounds for all dimensions except the first int col_max(int i, int j,int n, int m, int a[][]) ^ matrice12.cpp: In function 'int col_max(...)': matrice12.cpp:20:9: error: 'i' was not declared in this scope for(i=1; i<=n; i++) ^ matrice12.cpp:20:17: error: 'n' was not declared in this scope for(i=1; i<=n; i++) ^ matrice12.cpp:21:13: error: 'j' was not declared in this scope for(j=1; j<=m; j++) ^ matrice12.cpp:21:21: error: 'm' was not declared in this scope for(j=1; j<=m; j++) ^ matrice12.cpp:22:16: error: 'a' was not declared in this scope if(a[i][j]>maxim) ^ matrice12.cpp: At global scope: matrice12.cpp:29:47: error: declaration of 'a' as multidimensional array must have bounds for all dimensions except the first int col_min(int i, int j,int n,int m, int a[][]) ^ matrice12.cpp: In function 'int col_min(...)': matrice12.cpp:32:9: error: 'i' was not declared in this scope for(i=1; i<=n; i++) ^ matrice12.cpp:32:17: error: 'n' was not declared in this scope for(i=1; i<=n; i++) ^ matrice12.cpp:33:13: error: 'j' was not declared in this scope for(j=1; j<=m; j++) ^ matrice12.cpp:33:21: error: 'm' was not declared in this scope for(j=1; j<=m; j++) ^ matrice12.cpp:34:16: error: 'a' was not declared in this scope if(a[i][j]<minim) ^ matrice12.cpp: At global scope: matrice12.cpp:41:54: error: declaration of 'a' as multidimensional array must have bounds for all dimensions except the first void interschimbare(int i,int j,int n, int m,int a[][]) ^ matrice12.cpp: In function 'void interschimbare(...)': matrice12.cpp:44:14: error: 'n' was not declared in this scope for(b=1;b<=n;b++) ^ matrice12.cpp:45:10: error: 'a' was not declared in this scope swap(a[b][i],a[b][j]); ^ matrice12.cpp:45:15: error: 'i' was not declared in this scope swap(a[b][i],a[b][j]); ^ matrice12.cpp:45:23: error: 'j' was not declared in this scope swap(a[b][i],a[b][j]); ^ matrice12.cpp:45:25: error: 'swap' was not declared in this scope swap(a[b][i],a[b][j]); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Matrice12 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ă.