题解 | #记负均正#

记负均正

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

import sys
while True:
    try:
        n = int(input())
        L = list(map(int, input().split()))
        ZL = []
        FL = []
        for c in L:
            if c > 0:
                ZL.append(c)
            elif c < 0:
                FL.append(c)
        print(len(FL),round(sum(ZL) / len(ZL),1))
    except:
#         print(sys.exc_info())
        break















全部评论

相关推荐

评论
点赞
收藏
分享
牛客网
牛客企业服务