main(){int a=0;int b=0; /*a,b分别代表正整数和负整数的个数*/int n; /*n是输入的数组长度*/scanf("%d",&n);int *arr[]=new int[n]; for(int i=0;i{scanf("%d",arr[i]);}for(int i=0;i{if(arr[i]>0)a++;if(arr[i]<0)b++;}printf("%d,%d",a,b);}
用if else解决吧