题解 | #记负均正#

记负均正

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

n1=int(input())
n2=input()
count=0
sum=0
count2=0
#print(n2)
n3=n2.split(' ')
#print(n3)
for i in n3:
    if int(i)<0:
        count=count+1
    elif int(i)>0:
        sum=sum+int(i)
        count2=count2+1
    elif int(i)==0:
        continue
if count2==0:
    print(count,0.0)
else:
    print(count,round(sum/count2,1))
全部评论

相关推荐

不愿透露姓名的神秘牛友
07-11 11:00
点赞 评论 收藏
分享
07-11 11:15
中南大学 Java
好可爱的hr姐姐哈哈哈哈
黑皮白袜臭脚体育生:兄弟们貂蝉在一起,吕布开了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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