Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- int main() {
- int N, i, a, zero = 0, negative = 0, negamin = -1000000001, max = 1;
- scanf("%d", &N);
- for(i = 0; i < N; i++) {
- scanf("%d", &a);
- if(a == 0)
- zero = i;
- if(a < 0) {
- negative++;
- if(a > negamin)
- negamin = i;
- }
- }
- if(negative % 2 == 0)
- negamin = -1;
- for(i = 0; i < N; i++)
- if(i != zero && i != negamin)
- printf("%d ", i+1);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement