#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 | #64640128 | Utilizator | |
| Fișier | medpoz.cpp | Dimensiune | 451 B |
| Data încărcării | 19 Mai 2026, 21:48 | Scor/rezultat | Eroare de compilare |
medpoz.cpp:5:16: warning: missing terminating " character 5 | ofstream fout("medpoz.out); | ^ medpoz.cpp:5:16: error: missing terminating " character 5 | ofstream fout("medpoz.out); | ^~~~~~~~~~~~~ medpoz.cpp:6:12: error: expected ‘)’ before ‘{’ token 6 | int main() | ^ | ) 7 | {int n, i, j, a[21][21], s=0, k=0; | ~ medpoz.cpp:5:15: note: to match this ‘(’ 5 | ofstream fout("medpoz.out); | ^ medpoz.cpp: In function ‘std::ofstream fout(int (*)())’: medpoz.cpp:19:6: error: ‘m’ was not declared in this scope 19 | { m=s/k; | ^ medpoz.cpp:22:9: error: invalid operands of types ‘std::ofstream(int (*)())’ {aka ‘std::basic_ofstream<char>(int (*)())’} and ‘const char [10]’ to binary ‘operator<<’ 22 | {fout<<"NU EXISTA";} | ~~~~^~~~~~~~~~~~~ | | | | | const char [10] | std::ofstream(int (*)()) {aka std::basic_ofstream<char>(int (*)())} medpoz.cpp:23:8: error: could not convert ‘0’ from ‘int’ to ‘std::ofstream’ {aka ‘std::basic_ofstream<char>’} 23 | return 0; | ^ | | | int
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ă.