题解 | #记负均正#

记负均正

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

n = int(input())
num = list(map(int, input().split()))
count = 0
temp = []
for i in num:
    if i < 0:
        count += 1
for j in num:
    if j > 0:
        temp.append(j)

if len(temp) != 0:
    avage = sum(temp)/len(temp)
    print(count, round(avage, 1))
else:
    print(count, 0.0)

全部评论

相关推荐

offer小狗:就这样上秋招??
点赞 评论 收藏
分享
评论
点赞
收藏
分享
牛客网
牛客企业服务