题解 | #统计数据正负个数#

统计数据正负个数

http://www.nowcoder.com/practice/3f33889582934a09b4e3ddd3cc976226

a=input().split()
count1=0
count2=0
for i in range(len(a)):
    if int(a[i])>0:
        count1=count1+1
    else:
        count2=count2+1
print("positive:{}\nnegative:{}".format(count1,count2))

    
全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

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