#include<iostream>
using namespace std;
int main()
{
int array[15];
int count1=0,count2=0,count0=0;
cout<<"请输入10个整数:";
for(int i=1;i<=10;i++)
{
cin>>array[i];
if(array[i]>0)
count1++;
else if(array[i]<0)
count2++;
else count0++;
}
cout<<"正数个数"<<count1<<":"<<endl;
cout<<"负数个数"<<count2<<":"<<endl;
cout<<"零的个数"<<count0<<":"<<endl;
return 0;
}
//这是有交互的,不需要的话自行删掉
温馨提示:内容为网友见解,仅供参考