#1007
Matrice7
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 | #29965076 | Utilizator | |
Fișier | matrice7.cpp | Dimensiune | 805 B |
Data încărcării | 03 Iunie 2021, 11:05 | Scor / rezultat | Eroare de compilare |
matrice7.cpp:3:13: error: variable 'std::ifstream cin' has initializer but incomplete type ifstream cin("matrice7.in") ^ matrice7.cpp:4:1: error: expected ',' or ';' before 'ofstream' ofstream cout("matrice7.out") ^ matrice7.cpp: In function 'int main()': matrice7.cpp:8:5: error: reference to 'cin' is ambiguous cin>>n>>m; ^ matrice7.cpp:3:10: note: candidates are: <typeprefixerror>cin ifstream cin("matrice7.in") ^ In file included from matrice7.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ matrice7.cpp:8:10: error: 'n' was not declared in this scope cin>>n>>m; ^ matrice7.cpp:8:13: error: 'm' was not declared in this scope cin>>n>>m; ^ matrice7.cpp:9:9: error: 'i' was not declared in this scope for(i=1;i<=n;i++) ^ matrice7.cpp:10:13: error: 'j' was not declared in this scope for(j=1;j<=m;j++) ^ matrice7.cpp:12:9: error: reference to 'cin' is ambiguous cin>>x; ^ matrice7.cpp:3:10: note: candidates are: <typeprefixerror>cin ifstream cin("matrice7.in") ^ In file included from matrice7.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ matrice7.cpp:12:14: error: 'x' was not declared in this scope cin>>x; ^ matrice7.cpp:13:9: error: 'vmin' was not declared in this scope vmin=100000000; ^ matrice7.cpp:14:9: error: 'a' was not declared in this scope a[i][j]=b[i][j]=x; ^ matrice7.cpp:14:17: error: 'b' was not declared in this scope a[i][j]=b[i][j]=x; ^ matrice7.cpp:15:14: error: 'vmax' was not declared in this scope if(x>vmax) ^ matrice7.cpp:18:9: error: 'j' was not declared in this scope for(j=1;j<=m;j++) ^ matrice7.cpp:20:9: error: 'vmin' was not declared in this scope vmin=a[1][j]; ^ matrice7.cpp:20:14: error: 'a' was not declared in this scope vmin=a[1][j]; ^ matrice7.cpp:21:13: error: 'i' was not declared in this scope for(i=2;i<=n;i++) ^ matrice7.cpp:26:9: error: 'i' was not declared in this scope for(i=1;i<=n;i++) ^ matrice7.cpp:27:13: error: 'j' was not declared in this scope for(j=1;j<=m;j++) ^ matrice7.cpp:28:12: error: 'a' was not declared in this scope if(a[i][j]==vmax) ^ matrice7.cpp:28:21: error: 'vmax' was not declared in this scope if(a[i][j]==vmax) ^ matrice7.cpp:30:9: error: 'b' was not declared in this scope b[k][j]=a[0][j]; ^ matrice7.cpp:31:13: error: 'i' was not declared in this scope for(i=1;i<=n;i++) ^ matrice7.cpp:33:13: error: 'j' was not declared in this scope for(j=1;j<=m;j++) ^ matrice7.cpp:34:19: error: 'b' was not declared in this scope cout<<b[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ă.