#4252
Matrice11
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 linia pe care se află valoarea minimă cu elementele cu linia pe care se află valoarea maximă din matrice, apoi afișează 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 | Matrice11 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #47822270 | Utilizator | |
Fișier | matrice11.cpp | Dimensiune | 1.24 KB |
Data încărcării | 06 Ianuarie 2024, 13:12 | Scor / rezultat | Eroare de compilare |
matrice11.cpp:1:41: error: 'MAX_N' was not declared in this scope void citire(int& n, int& m, int matrice[MAX_N][MAX_M]) { ^ matrice11.cpp:1:48: error: 'MAX_M' was not declared in this scope void citire(int& n, int& m, int matrice[MAX_N][MAX_M]) { ^ matrice11.cpp: In function 'void citire(...)': matrice11.cpp:2:5: error: 'cin' was not declared in this scope cin >> n >> m; ^ matrice11.cpp:2:12: error: 'n' was not declared in this scope cin >> n >> m; ^ matrice11.cpp:2:17: error: 'm' was not declared in this scope cin >> n >> m; ^ matrice11.cpp:6:20: error: 'matrice' was not declared in this scope cin >> matrice[i][j]; ^ matrice11.cpp: At global scope: matrice11.cpp:9:40: error: 'MAX_N' was not declared in this scope void afisare(int n, int m, int matrice[MAX_N][MAX_M]) { ^ matrice11.cpp:9:47: error: 'MAX_M' was not declared in this scope void afisare(int n, int m, int matrice[MAX_N][MAX_M]) { ^ matrice11.cpp: In function 'void afisare(...)': matrice11.cpp:10:25: error: 'n' was not declared in this scope for (int i = 0; i < n; ++i) { ^ matrice11.cpp:11:29: error: 'm' was not declared in this scope for (int j = 0; j < m; ++j) ^ matrice11.cpp:12:13: error: 'cout' was not declared in this scope cout << matrice[i][j] << " "; ^ matrice11.cpp:12:21: error: 'matrice' was not declared in this scope cout << matrice[i][j] << " "; ^ matrice11.cpp:13:9: error: 'cout' was not declared in this scope cout << endl; ^ matrice11.cpp:13:17: error: 'endl' was not declared in this scope cout << endl; ^ matrice11.cpp: At global scope: matrice11.cpp:17:39: error: 'MAX_N' was not declared in this scope int lin_min(int n, int m, int matrice[MAX_N][MAX_M]) { ^ matrice11.cpp:17:46: error: 'MAX_M' was not declared in this scope int lin_min(int n, int m, int matrice[MAX_N][MAX_M]) { ^ matrice11.cpp: In function 'int lin_min(...)': matrice11.cpp:18:19: error: 'matrice' was not declared in this scope int min_val = matrice[0][0]; ^ matrice11.cpp:21:25: error: 'n' was not declared in this scope for (int i = 0; i < n; ++i) ^ matrice11.cpp:22:29: error: 'm' was not declared in this scope for (int j = 0; j < m; ++j) ^ matrice11.cpp: At global scope: matrice11.cpp:31:39: error: 'MAX_N' was not declared in this scope int lin_max(int n, int m, int matrice[MAX_N][MAX_M]) { ^ matrice11.cpp:31:46: error: 'MAX_M' was not declared in this scope int lin_max(int n, int m, int matrice[MAX_N][MAX_M]) { ^ matrice11.cpp: In function 'int lin_max(...)': matrice11.cpp:32:19: error: 'matrice' was not declared in this scope int max_val = matrice[0][0]; ^ matrice11.cpp:35:25: error: 'n' was not declared in this scope for (int i = 0; i < n; ++i) ^ matrice11.cpp:36:29: error: 'm' was not declared in this scope for (int j = 0; j < m; ++j) ^ matrice11.cpp: At global scope: matrice11.cpp:45:40: error: 'MAX_N' was not declared in this scope void interschimbare(int m, int matrice[MAX_N][MAX_M], int linie1, int linie2) { ^ matrice11.cpp:45:47: error: 'MAX_M' was not declared in this scope void interschimbare(int m, int matrice[MAX_N][MAX_M], int linie1, int linie2) { ^ matrice11.cpp:45:53: error: expected ')' before ',' token void interschimbare(int m, int matrice[MAX_N][MAX_M], int linie1, int linie2) { ^ matrice11.cpp:45:55: error: expected unqualified-id before 'int' void interschimbare(int m, int matrice[MAX_N][MAX_M], int linie1, int linie2) { ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Matrice11 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ă.