题解 | #统计数据正负个数#
统计数据正负个数
http://www.nowcoder.com/practice/3f33889582934a09b4e3ddd3cc976226
#include <stdio.h>
int main()
{
int a,zs=0,fs=0;
while(~scanf("%d",&a))
{
getchar();
a>0?zs++:fs++;
}
printf("positive:%d\nnegative:%d",zs,fs);
return 0;
}