#998
Se consideră o matrice pătratică cu n linii şi n coloane şi elemente numere naturale. Să se modifice matricea în felul următor: toate elementele de pe liniile care conţin valoare maximă din matrice vor fi mărite cu valoarea minimă din matrice.
| Problema | Matrice6 | Operații I/O |
matrice6.in/matrice6.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64092147 | Utilizator | |
| Fișier | matrice6.cpp | Dimensiune | 816 B |
| Data încărcării | 16 Aprilie 2026, 14:50 | Scor/rezultat | Eroare de compilare |
matrice6.cpp: In function ‘int main()’: matrice6.cpp:9:5: error: expected ‘,’ or ‘;’ before ‘ofstream’ 9 | ofstream fout("matrice6.out") | ^~~~~~~~ matrice6.cpp:11:10: error: ‘n’ was not declared in this scope 11 | fin>>n; | ^ matrice6.cpp:12:9: error: ‘i’ was not declared in this scope 12 | for(i=1; i<=n; i++) | ^ matrice6.cpp:13:13: error: ‘j’ was not declared in this scope 13 | for(j=1; j<=n; j++) | ^ matrice6.cpp:14:18: error: ‘a’ was not declared in this scope 14 | fin>>a[i][j]; | ^ matrice6.cpp:15:9: error: ‘i’ was not declared in this scope 15 | for(i=1; i<=n; i++) | ^ matrice6.cpp:16:13: error: ‘j’ was not declared in this scope 16 | for(j=1; j<=n; j++) | ^ matrice6.cpp:18:13: error: ‘x’ was not declared in this scope 18 | x=a[i][j]; | ^ matrice6.cpp:18:15: error: ‘a’ was not declared in this scope 18 | x=a[i][j]; | ^ matrice6.cpp:19:18: error: ‘mn’ was not declared in this scope 19 | if(x<mn) | ^~ matrice6.cpp:21:23: error: ‘mx’ was not declared in this scope 21 | else if(x>mx) | ^~ matrice6.cpp:24:9: error: ‘i’ was not declared in this scope 24 | for(i=1; i<=n; i++) | ^ matrice6.cpp:26:13: error: ‘j’ was not declared in this scope 26 | for(j=1; j<=n; j++) | ^ matrice6.cpp:27:16: error: ‘a’ was not declared in this scope 27 | if(a[i][j]==mx) | ^ matrice6.cpp:27:25: error: ‘mx’ was not declared in this scope 27 | if(a[i][j]==mx) | ^~ matrice6.cpp:30:30: error: ‘mn’ was not declared in this scope 30 | a[i][z]+=mn; | ^~ matrice6.cpp:32:9: error: ‘i’ was not declared in this scope 32 | for(i=1; i<=n; i++) | ^ matrice6.cpp:35:13: error: ‘j’ was not declared in this scope 35 | for(j=1; j<=n; j++) | ^ matrice6.cpp:36:13: error: ‘fout’ was not declared in this scope 36 | fout<<a[i][j]<<" "; | ^~~~ matrice6.cpp:36:19: error: ‘a’ was not declared in this scope 36 | fout<<a[i][j]<<" "; | ^ matrice6.cpp:37:9: error: ‘fout’ was not declared in this scope 37 | fout<<'\n'; | ^~~~ matrice6.cpp:39:5: error: ‘return0’ was not declared in this scope 39 | return0; | ^~~~~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Matrice6 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ă.