Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3. using namespace std;
  4. int main()
  5. {
  6.     int a[10];
  7.     double sr, sum=0;
  8.    
  9.  
  10.     for (int i = 0; i < 10; i++)
  11.     {
  12.         cout << "a[" << i << "]=";
  13.         cin >> a[i];
  14.     }
  15.  
  16.     for (int i = 0; i < 10; i++)
  17.     {
  18.         sum = sum + a[i];
  19.     }
  20.  
  21.     sr = sum / 10;
  22.     cout << sr;
  23.  
  24.     //for (int i = 0; i < 10; i++)
  25.     //{
  26.        
  27.     //      cout << a[i];
  28.     //  cout << endl;
  29.     //}
  30.  
  31.  
  32.  
  33.  
  34.     system("pause");
  35.     return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement