(1)使用一个计数器来判断终止条件 (2)用除以2后的余数来判断奇偶 2 代码 include<stdio.h>int main(){int count, sumEven, sumOdd;count = sumEven = sumOdd = 0;while (++count <= 100)count % 2 == 0 ? (sumEven += count) : (sumOdd += count);printf("偶数和: %d\n奇数...
(1)使用一个计数器来判断终止条件 (2)用除以2后的余数来判断奇偶 2 代码 include<stdio.h>int main(){int count, sumEven, sumOdd;count = sumEven = sumOdd = 0;while (++count <= 100)count % 2 == 0 ? (sumEven += count) : (sumOdd += count);printf("偶数和: %d\n奇数...