题解 | #记负均正#
记负均正
http://www.nowcoder.com/practice/6abde6ffcc354ea1a8333836bd6876b8
round 函数真好用
num = input() num_list = [int(i) for i in input().split(' ')] count = 0 over_list = [] for number in num_list: if number<0: count += 1 elif number > 0: over_list.append(number) if len(over_list) == 0: print(count,0.0) else: print(count,round(sum(over_list)/len(over_list),1))