好多数学题,这道题就当放松一下心情吧
#include<iostream> using namespace std; int main(){ int n; while(cin >> n){ int cnt = 0, num; for(int i = 0; i < n; i ++){ cin >>num; if(num % 2 == 0) cnt ++; else cnt --; } if(cnt > 0) cout << "NO" << endl; else cout << "YES" << endl; } return 0; }