题解 | #记负均正II#

记负均正II

https://www.nowcoder.com/practice/64f6f222499c4c94b338e588592b6a62


lista = []
fu_list = []
slist = []
while True:
    try:

        lista.append(int(input()))

    except:
        break

counts = 0
s = 0
p = 0
for i in lista:
    # print(i)
    if i < 0:
        counts += 1
    else:
        s += i
        p += 1
print(counts)
if p == 0:
    print("0.0")
else:
    print('{0:.1f}'.format(float(s / p)))

全部评论

相关推荐

06-07 19:59
门头沟学院 C++
补药卡我啊😭:都快15年前的了还在11新特性
你的简历改到第几版了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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