题解 | #记负均正#

记负均正

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

while True:
    try:
        n = int(input())
        s = list(map(int,input().split()))
        k = 0
        k1 = 0
        opt = 0
        for i in s:
            if i > 0:
                k1 += 1
                opt += i
            if i < 0:
                k += 1
        if opt != 0:
            opt = round(float(opt/k1)*10)/10
        if opt == 0:
            opt = 0.0
        print(str(k) + ' ' + str(opt))
    except:
        break
全部评论

相关推荐

炫哥_:哥们项目描述里面vector和mysql之类的都要写吗,直接开头技术栈巴拉巴拉就行了,完全不是技术点啊
点赞 评论 收藏
分享
点赞 评论 收藏
分享
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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