#1568
Se citeşte de la tastatură un număr natural n. Să se calculeze şi să se afişeze media aritmetică a tuturor divizorilor săi. Media va fi cu fix 2 zecimale dupa virgula.
| Problema | MedieDiv | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64925770 | Utilizator | |
| Fișier | mediediv.cpp | Dimensiune | 426 B |
| Data încărcării | 14 Iunie 2026, 21:27 | Scor/rezultat | Eroare de compilare |
mediediv.cpp:2:10: error: #include expects "FILENAME" or <FILENAME> 2 | #include iomanip | ^~~~~~~ mediediv.cpp:4:5: error: expected declaration before ‘}’ token 4 | } cout << fixed << setprecision(2) << (float) S / temp; | ^ mediediv.cpp:4:7: error: ‘cout’ does not name a type 4 | } cout << fixed << setprecision(2) << (float) S / temp; | ^~~~ mediediv.cpp:5:5: error: expected unqualified-id before ‘return’ 5 | return 0; | ^~~~~~ mediediv.cpp:6:1: error: expected declaration before ‘}’ token 6 | }int main() { | ^ mediediv.cpp: In function ‘int main()’: mediediv.cpp:17:14: error: expected ‘}’ at end of input 17 | } | ^ mediediv.cpp:11:25: note: to match this ‘{’ 11 | if (n % i == 0) { | ^ mediediv.cpp:17:14: error: expected ‘}’ at end of input 17 | } | ^ mediediv.cpp:10:38: note: to match this ‘{’ 10 | for (int i = 1; i * i <= n; i++) { | ^ mediediv.cpp:17:14: error: expected ‘}’ at end of input 17 | } | ^ mediediv.cpp:6:13: note: to match this ‘{’ 6 | }int main() { | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema MedieDiv 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ă.