Advertisement
Md_Touhid

URI - Problem 1006 - Average 2

Apr 13th, 2020
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include<iostream>
  2. #include<cstdio> //for printf()
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     float a, b, c, media;
  9.     cin >> a;
  10.     cin >> b;
  11.     cin >> c;
  12.  
  13.     media = (a*2 + b*3 + c*5) / (2+3+5);
  14.  
  15.     printf("MEDIA = %.1f\n", media); //new line for presentation error
  16.  
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement