题解 | #记负均正II##python#

记负均正II

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

list1 = []
while True:
    try:
        list1.append(int(input()))
    except:
        break
fs = 0
ffs = 0
ffs_count = 0
pjz = 0.0
for i in list1:
    if i < 0:
        fs += 1
    else:
        ffs += 1
        ffs_count += i
if ffs != 0:
    pjz = round(ffs_count/ffs,1)
print(fs)
print(pjz)
#华为机试##Python#
全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

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