题解 | #记负均正II#

记负均正II

http://www.nowcoder.com/practice/64f6f222499c4c94b338e588592b6a62

nums=[]

while True:
    try:
        nums.append(int(input()))
    except:
        break
count1,count2,plus=0,0,0
for i in nums:
    if i<0:
        count1+=1
    if i>0:
        count2+=1
        plus+=i
print (count1)
if count2==0:
    print(0.0)
else:
    print(round(plus/count2,1))

全部评论
该牛油正在参与牛客写题解薅羊毛的活动,牛币,周边,京东卡超多奖品放送,活动进入倒计时!快来捡漏啦https://www.nowcoder.com/discuss/888949?source_id=profile_create_nctrack&channel=-1
点赞 回复 分享
发布于 2022-04-20 17:30

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务