Advertisement
Guest User

5567

a guest
Mar 30th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.53 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. int main() {
  5.     int N, i, a, zero = 0, negative = 0, negamin = -1000000001, max = 1;
  6.     scanf("%d", &N);
  7.     for(i = 0; i < N; i++) {
  8.         scanf("%d", &a);
  9.         if(a == 0)
  10.             zero = i;
  11.         if(a < 0) {
  12.             negative++;
  13.             if(a > negamin)
  14.                 negamin = i;
  15.         }
  16.     }
  17.  
  18.     if(negative % 2 == 0)
  19.         negamin = -1;
  20.  
  21.     for(i = 0; i < N; i++)
  22.         if(i != zero && i != negamin)
  23.             printf("%d ", i+1);
  24.  
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement