#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 | #52774420 | Utilizator | |
Fișier | matrice12.cpp | Dimensiune | 900 B |
Data încărcării | 09 Octombrie 2024, 09:36 | Scor / rezultat | Eroare de compilare |
matrice12.cpp: In function 'void citire()': matrice12.cpp:3:5: error: 'cin' was not declared in this scope cin >> n >> m; ^ matrice12.cpp:3:12: error: 'n' was not declared in this scope cin >> n >> m; ^ matrice12.cpp:3:17: error: 'm' was not declared in this scope cin >> n >> m; ^ matrice12.cpp:5:14: error: 'j' was not declared in this scope for (j=1; j<=m; j++) ^ matrice12.cpp:6:20: error: 'mat' was not declared in this scope cin >> mat[i][j]; ^ matrice12.cpp: In function 'void afisare()': matrice12.cpp:12:22: error: 'n' was not declared in this scope for (int i=1; i<=n; i++) ^ matrice12.cpp:13:14: error: 'j' was not declared in this scope for (j=1; j<=m; j++) ^ matrice12.cpp:13:22: error: 'm' was not declared in this scope for (j=1; j<=m; j++) ^ matrice12.cpp:15:13: error: 'cout' was not declared in this scope cout << a[i][j] << " "; ^ matrice12.cpp:15:21: error: 'a' was not declared in this scope cout << a[i][j] << " "; ^ matrice12.cpp:16:21: error: 'endl' was not declared in this scope cout << endl; ^ matrice12.cpp: In function 'int imax()': matrice12.cpp:23:22: error: 'n' was not declared in this scope for (int i=1; i<=n; i++) ^ matrice12.cpp:24:14: error: 'j' was not declared in this scope for (j=1; j<=m; j++) ^ matrice12.cpp:24:22: error: 'm' was not declared in this scope for (j=1; j<=m; j++) ^ matrice12.cpp:25:17: error: 'mat' was not declared in this scope if (mat[i][j]>max) ^ matrice12.cpp: In function 'int imin()': matrice12.cpp:36:22: error: 'n' was not declared in this scope for (int i=1; i<=n; i++) ^ matrice12.cpp:37:14: error: 'j' was not declared in this scope for (j=1; j<=m; j++) ^ matrice12.cpp:37:22: error: 'm' was not declared in this scope for (j=1; j<=m; j++) ^ matrice12.cpp:38:17: error: 'mat' was not declared in this scope if (mat[i][j]<mini) ^ matrice12.cpp:40:17: error: 'min' was not declared in this scope min=mat[i][j]; ^ matrice12.cpp:42:13: error: expected ';' before '}' token } ^ matrice12.cpp: In function 'void interschimbare(int, int)': matrice12.cpp:48:22: error: 'n' was not declared in this scope for (int i=1; i<=n; i++) ^ matrice12.cpp:49:15: error: 'mat' was not declared in this scope swap (mat[i][x], mat[i][y]); ^ matrice12.cpp:49:35: error: 'swap' was not declared in this scope swap (mat[i][x], mat[i][y]); ^
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ă.