int main(void)
{
const int number=10;
int x=0;
int count[number]={0};
printf("请输入数字:");
scanf("%d",&x);
while(x!=-1){
if(x>=0&&x<=9){
count[x]++;
}
scanf("%d",&x);
}
for(int i=0;i<number;i++){
printf("%d:%d\n",i,count[i]);
}
return 0;
}
运行输出数字次数都是0