题解 | #统计数据正负个数#
统计数据正负个数
http://www.nowcoder.com/practice/3f33889582934a09b4e3ddd3cc976226
#include<stdio.h> int main() { int a,i,b[10],c=0,d=0; for(i=0;i<10;i++) { scanf("%d",&b[i]); if(b[i]>=0) c++; else d++; } printf("positive:%d\nnegative:%d",c,d); return 0; }