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