#234
Se dă o matrice cu elemente numere întregi. Să se determine media aritmetică a elementelor strict pozitive din matrice, care sunt situate sub diagonala principală.
Variante Bacalaureat 2009
| Problema | MedPoz | Operații I/O |
medpoz.in/medpoz.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64910609 | Utilizator | |
| Fișier | medpoz.cpp | Dimensiune | 1.87 KB |
| Data încărcării | 11 Iunie 2026, 20:30 | Scor/rezultat | Eroare de compilare |
medpoz.cpp:26:2: error: stray ‘#’ in program 26 | }#include <iomanip> | ^ medpoz.cpp:51:2: error: stray ‘#’ in program 51 | }#include <iomanip> | ^ medpoz.cpp:26:3: error: ‘include’ does not name a type 26 | }#include <iomanip> | ^~~~~~~ medpoz.cpp:29:10: error: redefinition of ‘std::ifstream in’ 29 | ifstream in("medpoz.in"); | ^~ medpoz.cpp:4:10: note: ‘std::ifstream in’ previously declared here 4 | ifstream in("medpoz.in"); | ^~ medpoz.cpp:30:10: error: redefinition of ‘std::ofstream out’ 30 | ofstream out("medpoz.out"); | ^~~ medpoz.cpp:5:10: note: ‘std::ofstream out’ previously declared here 5 | ofstream out("medpoz.out"); | ^~~ medpoz.cpp:31:5: error: redefinition of ‘int mat [101][101]’ 31 | int mat[101][101], n; | ^~~ medpoz.cpp:6:5: note: ‘int mat [101][101]’ previously declared here 6 | int mat[101][101], n; | ^~~ medpoz.cpp:31:20: error: redefinition of ‘int n’ 31 | int mat[101][101], n; | ^ medpoz.cpp:6:20: note: ‘int n’ previously declared here 6 | int mat[101][101], n; | ^ medpoz.cpp:32:5: error: redefinition of ‘int main()’ 32 | int main() { | ^~~~ medpoz.cpp:7:5: note: ‘int main()’ previously defined here 7 | int main() { | ^~~~ medpoz.cpp:51:3: error: ‘include’ does not name a type 51 | }#include <iomanip> | ^~~~~~~ medpoz.cpp:54:10: error: redefinition of ‘std::ifstream in’ 54 | ifstream in("medpoz.in"); | ^~ medpoz.cpp:4:10: note: ‘std::ifstream in’ previously declared here 4 | ifstream in("medpoz.in"); | ^~ medpoz.cpp:55:10: error: redefinition of ‘std::ofstream out’ 55 | ofstream out("medpoz.out"); | ^~~ medpoz.cpp:5:10: note: ‘std::ofstream out’ previously declared here 5 | ofstream out("medpoz.out"); | ^~~ medpoz.cpp:56:5: error: redefinition of ‘int mat [101][101]’ 56 | int mat[101][101], n; | ^~~ medpoz.cpp:6:5: note: ‘int mat [101][101]’ previously declared here 6 | int mat[101][101], n; | ^~~ medpoz.cpp:56:20: error: redefinition of ‘int n’ 56 | int mat[101][101], n; | ^ medpoz.cpp:6:20: note: ‘int n’ previously declared here 6 | int mat[101][101], n; | ^ medpoz.cpp:57:5: error: redefinition of ‘int main()’ 57 | int main() { | ^~~~ medpoz.cpp:7:5: note: ‘int main()’ previously defined here 7 | int main() { | ^~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema MedPoz 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ă.