Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- int t,Ev=0,Od=0,Po=0,Ne=0;
- cin>>t;
- for(int i=1;i<=t;i++)
- {
- int x;
- cin>>x;
- if(x<0)
- {
- Ne+=1;
- }
- else
- {
- if(x%2==0)
- {
- Ev+=1;
- }
- else if(x%2!=0)
- {
- Od+=1;
- }
- else if(x>0)
- {
- Po+=1;
- }
- }
- }
- cout<<"Even: "<<Ev<<endl<<"Odd: "<<Od<<endl<<"Positive: "<<Po<<endl<<"Negative: "<<Ne<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement