题解 | 记负均正
def fun(): n = int(input()) m = list(map(int,input().split())) neg_num = 0 pos_num = [] for i in m: if i < 0: neg_num += 1 if i > 0: pos_num.append(i) if len(pos_num) == 0: mean_value = 0 else: mean_value = sum(pos_num)/len(pos_num) return neg_num, "{:.1f}".format(mean_value) neg_num, mean_value = fun() print(neg_num, mean_value)