条件判断老是把=当成==
今日练习,奇偶个数判断
#include <stdio.h>
int main()
{
int num;
int count1 = 0;
int count2 = 0;
scanf("%d", &num);
while (num != -1) {
num %= 2;
if(num == 0) {
count2++;
} else {
count1++;
}
scanf("%d", &num);
}
printf("%d %d", count1, count2);
return 0;
}