题解 | #记负均正#
记负均正
http://www.nowcoder.com/practice/6abde6ffcc354ea1a8333836bd6876b8
import sys
while True:
try:
n = int(input())
L = list(map(int, input().split()))
ZL = []
FL = []
for c in L:
if c > 0:
ZL.append(c)
elif c < 0:
FL.append(c)
print(len(FL),round(sum(ZL) / len(ZL),1))
except:
# print(sys.exc_info())
break
查看20道真题和解析