Advertisement
egormerk

first

Apr 23rd, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int N, a[1000], sr = 0;;
  8.     cin >> N;
  9.     for (int i = 0; i < N; i++) {
  10.         cin >> a[i];
  11.         sr+=a[i];
  12.     }
  13.     sr/=N;
  14.     for (int i = 0; i < N; i ++) {
  15.         if ((a[i] > 9) and (a[i] < 100)) a[i] = sr;
  16.         cout << a[i] << " ";
  17.     }
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement