字符串数组遇到8就出问题 请问是什么原因
#include<stdio.h>#include<string.h>
int main()
{
char x[1001];
scanf("%s",x);
int a=0,b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;
for(int i=0;i<strlen(x);i++)
{
switch(x[i])
{
case '0':{a++;break;}
case '1':{b++;break;}
case '2':{c++;break;}
case '3':{d++;break;}
case '4':{e++;break;}
case '5':{f++;break;}
case '6':{g++;break;}
case '7':{h++;break;}
case '8':{i++;break;}
case '9':{j++;break;}
default:{};
}}
if(a!=0)printf("0:%d\n",a);
if(b!=0)printf("1:%d\n",b);
if(c!=0)printf("2:%d\n",c);
if(d!=0)printf("3:%d\n",d);
if(e!=0)printf("4:%d\n",e);
if(f!=0)printf("5:%d\n",f);
if(g!=0)printf("6:%d\n",g);
if(h!=0)printf("7:%d\n",h);
if(i!=0)printf("8:%d\n",i);
if(j!=0)printf("9:%d\n",j);
return 0;}