题解 | #记负均正II#
记负均正II
https://www.nowcoder.com/practice/64f6f222499c4c94b338e588592b6a62
import sys
num_list = []
for line in sys.stdin:
num_list.append(int(line.split()[0]))
f_list = []
n_list = []
for i in num_list:
if i < 0:
f_list.append(i)
else:
n_list.append(i)
print(len(f_list))
if n_list:
print(round(sum(n_list)/len(n_list),1))
else:
print(0.0)
#学习记录#
num_list = []
for line in sys.stdin:
num_list.append(int(line.split()[0]))
f_list = []
n_list = []
for i in num_list:
if i < 0:
f_list.append(i)
else:
n_list.append(i)
print(len(f_list))
if n_list:
print(round(sum(n_list)/len(n_list),1))
else:
print(0.0)
#学习记录#