artemgf

Теплотрасса

Mar 18th, 2017
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3. #include <string>
  4. #include <set>
  5. #include <map>
  6. #include <algorithm>
  7. #include <string>
  8. #include <math.h>
  9. #include <vector>
  10.  
  11. using namespace std;
  12.  
  13. int main()
  14. {
  15.     long long prom;
  16.     double result, sum = 0, n;
  17.  
  18.     cin >> n;
  19.     cout.setf(ios::fixed);
  20.     cout.precision(6);
  21.     for (int i = 1; i <= n; i++)
  22.     {
  23.         cin >> prom;
  24.         sum = sum + prom;
  25.     }
  26.  
  27.     result = (sum*2.0) / (n * 2.0);
  28.     cout << result;
  29.  
  30.     _getch();
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment