《算法笔记》codeup_100000575_D.

解答:

#include <cstdio>
#include <cstring>
using namespace std;

int main() {
	int n;
	while(scanf("%d", &n) != EOF) {
		int odd = 0;
		int even = 0;
		
		while(n--) {
			int num;
			scanf("%d", &num);
			if(num%2 == 0) {
				even++;
			}
			else if(num%2 > 0) {
				odd++;
			}
		}
		
		if(even > odd)
			printf("NO\n");
		else
			printf("YES\n");
	}
	
	return 0;
} 
发布了43 篇原创文章 · 获赞 3 · 访问量 1367

猜你喜欢

转载自blog.csdn.net/Zen_Ivan/article/details/105476856