题解 | 记负均正
n=int(input()) l=map(int,input().split()) c1=0 c2=0 sum=0 for i in l: if i>0: sum+=i c1+=1 if i<0: c2+=1 if c1==0: print(c2,c1) else: print(c2,round(sum/(c1),6))
n=int(input()) l=map(int,input().split()) c1=0 c2=0 sum=0 for i in l: if i>0: sum+=i c1+=1 if i<0: c2+=1 if c1==0: print(c2,c1) else: print(c2,round(sum/(c1),6))
相关推荐