题解 | #记负均正#

记负均正

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

a = int(input())
b, *args = map(int, input().split())
list1 = [b, *args]
list2 = []
list3 = []
for i in list1:
    if i < 0:
        list2.append(i)
cc = len(list2)
for j in list1:
    if j > 0:
        list3.append(j)
ss = sum(list3)
ll = len(list3)
if ss !=0:
    print(cc,round(ss/ll,1))
else:
    print(cc,0.0)

全部评论

相关推荐

鼠鼠第一次实习,啥也不懂一直是自己一个人吃的饭,不会做工作老是被嫌弃,大人的世界是这样的吗?
我是星星我会发亮:好的mt有两种,一种愿意教你的,一种几乎什么活都不给你派让你很闲允许你做自己事情的
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务