题解 | #查找输入整数二进制中1的个数#
查找输入整数二进制中1的个数
http://www.nowcoder.com/practice/1b46eb4cf3fa49b9965ac3c2c1caf5ad
sum1 = 0
sum2 = 0
k = 0.0
while(True):
try:
i = int(input())
if i<0:
sum1=sum1+1
else:
sum2=sum2+i
k=k+1
try:
a = sum2/k
except:
a = 0.0
except:
break
print("%d" % (sum1))
print("%.1f" % (a))