题解 | #记负均正II#
记负均正II
http://www.nowcoder.com/practice/64f6f222499c4c94b338e588592b6a62
输入处理好后其实并不难
res = []
while True:
try:
res.append(int(input()))
except:
k1 = 0
opt = 0
k2 = 0
for i in res:
if i < 0:
k1 += 1
elif i >= 0:
opt += i
k2 += 1
if k2 == 0:
opt = 0.0
else:
opt = round(float(opt/k2)*10)/10
print(k1)
print(opt)
break