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