题解 | 记负均正

记负均正

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

import sys

n = input()
nums = [int(_) for _ in input().split(" ")]
fu = 0
ping = 0.0
ping_count = 0
for _ in nums:
    if _ < 0:
        fu += 1
    elif _ > 0:
        ping += _
        ping_count += 1
if not ping_count:
    ping_count = 1
print(fu,round(ping*1.0/ping_count*1.0,11))

全部评论

相关推荐

09-22 15:45
门头沟学院 Java
谁给娃offer我给...:我也遇到了,我说只要我通过面试我就去,实际上我根本就不会去😁
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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