Advertisement
dllbridge

Untitled

Nov 6th, 2022
741
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int   a;
  5. float b,
  6.       s;
  7.  
  8. ///////////////////////////////
  9. int main()                  //
  10. {
  11.    
  12.    cin >> a;
  13.    
  14.    for(int i = 0; i < a; i++)
  15.    {
  16.       cin >> b;
  17.       s += b;
  18.    }
  19.    
  20.    s = s / a;
  21.    cout.precision(12);
  22.    cout <<  fixed << s;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement