题解 | #记负均正II#
记负均正II
https://www.nowcoder.com/practice/64f6f222499c4c94b338e588592b6a62
lst=[] while True: try: lst.append(int(input())) except: break fu=[]#负数 zn=[]#正数 for i in lst: if i<0: fu.append(i) else: zn.append(i) print(len(fu)) if len(zn)==0: print(0.0) else: print(format(sum(zn)/len(zn),'.1f'))#format用法也要学会 #print(round(sum(zn)/len(zn),1))#最好不要用round