#1007
Se consideră o matrice cu n linii şi m coloane şi elemente numere naturale. Să se modifice matricea în felul următor: toate elementele egale cu valoarea maximă din matrice se înlocuiesc cu valoarea minimă de pe coloana lor.
| Problema | Matrice7 | Operații I/O |
matrice7.in/matrice7.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64660375 | Utilizator | |
| Fișier | matrice7.cpp | Dimensiune | 718 B |
| Data încărcării | 21 Mai 2026, 09:04 | Scor/rezultat | Eroare de compilare |
matrice7.cpp:4:29: error: expected ‘)’ before ‘int’ 4 | ofstream fout("matrice7.out" | ~ ^ | ) 5 | int n,m,i,j,mini,maxi,a[101][101]; | ~~~ matrice7.cpp:5:7: error: ‘m’ was not declared in this scope; did you mean ‘tm’? 5 | int n,m,i,j,mini,maxi,a[101][101]; | ^ | tm matrice7.cpp:5:9: error: ‘i’ was not declared in this scope 5 | int n,m,i,j,mini,maxi,a[101][101]; | ^ matrice7.cpp:5:11: error: ‘j’ was not declared in this scope 5 | int n,m,i,j,mini,maxi,a[101][101]; | ^ matrice7.cpp:5:13: error: ‘mini’ was not declared in this scope 5 | int n,m,i,j,mini,maxi,a[101][101]; | ^~~~ matrice7.cpp:5:18: error: ‘maxi’ was not declared in this scope 5 | int n,m,i,j,mini,maxi,a[101][101]; | ^~~~ matrice7.cpp:5:23: error: ‘a’ was not declared in this scope 5 | int n,m,i,j,mini,maxi,a[101][101]; | ^ matrice7.cpp: In function ‘int main()’: matrice7.cpp:8:10: error: ‘n’ was not declared in this scope 8 | fin>>n; | ^ matrice7.cpp:9:9: error: ‘i’ was not declared in this scope 9 | for(i=1; i<=n; i++) | ^ matrice7.cpp:10:13: error: ‘j’ was not declared in this scope 10 | for(j=1; j<=m; j++) | ^ matrice7.cpp:10:21: error: ‘m’ was not declared in this scope; did you mean ‘tm’? 10 | for(j=1; j<=m; j++) | ^ | tm matrice7.cpp:12:18: error: ‘a’ was not declared in this scope 12 | fin>>a[i][j]; | ^ matrice7.cpp:13:24: error: ‘maxi’ was not declared in this scope 13 | if(a[i][j]>maxi) | ^~~~ matrice7.cpp:17:9: error: ‘j’ was not declared in this scope 17 | for(j=1; j<=m; j++) | ^ matrice7.cpp:17:17: error: ‘m’ was not declared in this scope; did you mean ‘tm’? 17 | for(j=1; j<=m; j++) | ^ | tm matrice7.cpp:19:9: error: ‘mini’ was not declared in this scope 19 | mini=999999999; | ^~~~ matrice7.cpp:20:13: error: ‘i’ was not declared in this scope 20 | for(i=1; i<=n; i++) | ^ matrice7.cpp:21:16: error: ‘a’ was not declared in this scope 21 | if(a[i][j]<mini) | ^ matrice7.cpp:23:13: error: ‘i’ was not declared in this scope 23 | for(i=1; i<=n; i++) | ^ matrice7.cpp:24:16: error: ‘a’ was not declared in this scope 24 | if(a[i][j]==maxi) | ^ matrice7.cpp:24:25: error: ‘maxi’ was not declared in this scope 24 | if(a[i][j]==maxi) | ^~~~ matrice7.cpp:27:9: error: ‘i’ was not declared in this scope 27 | for(i=1; i<=n; i++) | ^ matrice7.cpp:29:13: error: ‘j’ was not declared in this scope 29 | for(j=1; j<=m; j++) | ^ matrice7.cpp:29:21: error: ‘m’ was not declared in this scope; did you mean ‘tm’? 29 | for(j=1; j<=m; j++) | ^ | tm matrice7.cpp:30:13: error: ‘cout’ was not declared in this scope 30 | cout<<a[i][j]<<" "; | ^~~~ matrice7.cpp:2:1: note: ‘std::cout’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’? 1 | #include <fstream> +++ |+#include <iostream> 2 | using namespace std; matrice7.cpp:30:19: error: ‘a’ was not declared in this scope 30 | cout<<a[i][j]<<" "; | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Matrice7 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ă.