题解 | #奇偶统计#
奇偶统计
http://www.nowcoder.com/practice/04de8eb0ecab426fa6be3ae99af17210
#include <stdio.h>
int main()
{
int n,o,i;
scanf("%d",&n);
if(n%2==0)
printf("%d %d",n/2,n/2);
else
printf("%d %d",n/2+1,(n-1)/2);
return 0;
}
奇偶统计
http://www.nowcoder.com/practice/04de8eb0ecab426fa6be3ae99af17210
#include <stdio.h>
int main()
{
int n,o,i;
scanf("%d",&n);
if(n%2==0)
printf("%d %d",n/2,n/2);
else
printf("%d %d",n/2+1,(n-1)/2);
return 0;
}
相关推荐