比较奇偶数个数 题解:C
#include <stdio.h>
int main()
{
int n,even,odd,num;
while(scanf("%d",&n) != EOF)
{
even = odd = 0;
while(n)
{
scanf("%d",&num);
if(num % 2 == 0) even++;
else odd++;
n--;
}
if(even > odd) printf("NO\n");
else printf("YES\n");
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发