题解 | #奇偶统计#
奇偶统计
https://www.nowcoder.com/practice/04de8eb0ecab426fa6be3ae99af17210
#include <stdio.h> int main() { int n = 0, odd = 0, even = 0; scanf("%d", &n); while (n) { if (n % 2 == 0) even++; else odd++; n--; } printf("%d %d", odd, even); return 0; }