Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <iomanip>
- #include <fstream>
- using namespace std;
- int main()
- {
- int n,impare=0, pare=0, v[100];
- cin>>n;
- for(int i=0; i<n; i++)
- {
- cin>>v[i];
- }
- for(int i=0; i<n; i++)
- {
- if(v[i]%2==0)
- impare++;
- if(v[i]%2==1)
- pare++;
- }
- if(impare>pare)
- cout<<impare-pare;
- else
- cout<<pare-impare;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement