Lucian_Adrian

Untitled

Nov 23rd, 2021
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int n,x,cate=0,cate1=0;
  6. cin >> n;
  7. for(int i=1;i<=n;++i)
  8. {
  9. cin >>x;
  10. if(x%2==0) cate++;
  11. else
  12. cate1++;
  13. }
  14. cout <<abs(cate-cate1);
  15. return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment