Dang_Quan_10_Tin

SUM

Aug 18th, 2020 (edited)
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main(){
  4.     int a[35], n, sum(0);
  5.     cin >> n;
  6.     for(int i = 1; i <= n; ++i)
  7.         cin >> a[i],
  8.         sum += a[i];
  9.     for(int i = 1; i <= n; ++i)
  10.         if(a[i] >= (double) sum * 1.0 / n)
  11.             cout << a[i] << " ";
  12. }
Add Comment
Please, Sign In to add comment