BC80 奇偶统计
思路:
step1:奇数偶数分离,判断是否能整除2即可;打印输出;
代码如下:
n = int(input())
c = []
for i in range(1,n+1):
if i%2 == 0:
c.append(i)
oushu = len(c)
jishu = n-len(c)
print('{} {}'.format(jishu,oushu))
n = int(input())
c = []
for i in range(1,n+1):
if i%2 == 0:
c.append(i)
oushu = len(c)
jishu = n-len(c)
print('{} {}'.format(jishu,oushu))