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

