fork download
  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4.  
  5. int main() {
  6. float A, B, C, MEDIA;
  7. cin >> A >> B >> C;
  8. MEDIA = ((A * 2) + (B * 3) + (C * 5)) / (2 + 3 + 5);
  9. cout << fixed << setprecision(1);
  10. cout << "MEDIA = " << MEDIA << endl;
  11. return 0;
  12. }
  13.  
Success #stdin #stdout 0s 3432KB
stdin
5
6
7
stdout
MEDIA = 6.3