fork download
  1. #include<stdio.h>
  2. int main()
  3. {
  4. int n;
  5. int x;
  6. int even=0, odd=0, pos=0, neg=0;
  7. scanf("%d",&n);
  8. for(int i=1; i<=n; i++)
  9. {
  10. scanf("%d",&x);
  11. if (x%2 == 0)
  12. {
  13. even++;
  14. }
  15. else{
  16. odd++;
  17. }
  18. if(x > 0)
  19. {
  20. pos++;
  21. }
  22. else if(x < 0){
  23. neg++;
  24. }
  25. printf("Even: %d\n",even);
  26. printf("Odd: %d\n", odd);
  27. printf("Positive: %d\n",pos);
  28. printf("Negative: %d\n",neg);
  29. }
  30. return 0;
  31. }
Success #stdin #stdout 0.01s 5288KB
stdin
 
stdout
Standard output is empty