题解 | #记负均正#

记负均正

https://www.nowcoder.com/practice/6abde6ffcc354ea1a8333836bd6876b8

n = int(input())
ls = list(map(int,input().split()))
ls1 = []
ls2 = []
for i in ls:
    if i == 0:
        continue
    elif i > 0:
        ls1.append(i)
    elif i < 0:
        ls2.append(i)
if len(ls1) != 0:
    print((len(ls2)),round(sum(ls1)/len(ls1),1))
else:
    print(len(ls2),0.0)

全部评论

相关推荐

MomonKa:我拿Java简历投了pdd前端也给我简历过筛了
点赞 评论 收藏
分享
02-23 00:10
湖南大学 C++
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务