题解 | #记负均正#
记负均正
https://www.nowcoder.com/practice/6abde6ffcc354ea1a8333836bd6876b8
while True: try: n = int(input()) numbers = list(map(int, input().split())) zhenshu = 0 zhenshu_count = 0 fushu_count = 0 for i in numbers: if i < 0: fushu_count += 1 elif i > 0: zhenshu += i zhenshu_count += 1 if zhenshu_count == 0: print(fushu_count, '0.0') else: ave = zhenshu/zhenshu_count print(fushu_count, '%.1f'%ave) except: break