Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     const int N = 7;
  7.     int ar[N] = {-1,-2,3,-10,2,1,80};
  8.    
  9.     int sum = 0;
  10.     for(int i = 0; i < N; i++)
  11.         sum += ar[i];
  12.     for(int i = 0; i < N; i++)
  13.     {
  14.         if(ar[i] > sum) cout << i << " ";
  15.     }
  16.     cout << endl;
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement