题解 | #记负均正II#
记负均正II
https://www.nowcoder.com/practice/64f6f222499c4c94b338e588592b6a62
s = [] # 记录非负数 c = 0 # 记录负数个数 while 1: try: num=int(input()) if num>=0: s.append(num) else: c+=1 #判断输入结束 except EOFError: if len(s)==0: print(c) print(0.0) else: print(c) avg = sum(s) / len(s) print(f'%.1f' %avg) break