Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int t;
- scanf("%d", &t);
- while(t--)
- {
- int n;
- scanf("%d", &n);
- int a[n], i;
- for(i = 0; i < n; i++) scanf("%d", &a[i]);
- int s = 0, c = 0;
- for(i = 0; i < n; i++)
- {
- if(a[i] == 0) c++;
- s += a[i];
- }
- if(s + c == 0) c++;
- printf("%d\n", c);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment