fork download
  1. #include <iostream>
  2. using namespace std;
  3. int main(){
  4.  
  5.  
  6. int x,y;
  7. long long even=0,odd=0,postive=0,negative=0;
  8.  
  9. cin>>x;
  10. for(int i=0;i<x;i++){
  11. cin>>y;
  12.  
  13.  
  14. if(y%2==0){
  15. even++;
  16.  
  17. }else {
  18. odd++;
  19.  
  20. }
  21.  
  22. if(y>0){
  23. postive++;
  24.  
  25. }else {
  26.  
  27. negative++;
  28. }
  29. }
  30.  
  31. cout<<"Even: "<<even<<endl;
  32. cout<<"Odd: "<<odd<<endl;
  33. cout<<"Postive: "<<postive<<endl;
  34. cout<<"Negative: "<<negative<<endl;
  35. }
  36.  
Success #stdin #stdout 0s 5316KB
stdin
Standard input is empty
stdout
Even: 0
Odd: 0
Postive: 0
Negative: 0