题解 | 统计数据正负个数
#include <stdio.h>
int main() {
int num;
int positive = 0;
int negative = 0;
for(int i = 0;i<10;i++){
scanf("%d ",&num);
if(num>0)
positive++;
else if(num<0)
negative++;
}
printf("positive:%d\nnegative:%d",positive,negative);
return 0;
}