这个程序为什么运行不了

img

img

修改如下,供参考:

#include<stdio.h>
#include<math.h>
int main()
{
    char c,a[100];
    int  n=0,i=0,digit=0,b[100];
    printf("pls input string:\n");
    while((c=getchar())!='\n')
    {
        if(c>='0' && c<='9')
           a[i++]=c;
    }
    if(i==0)
    {
        printf("No found!\n");
    }
    else{
        for(n=0;n<i;n++)
            digit = digit*10 + a[n]-'0';
        printf("the num in 十 进 制 is:%d\n",digit);
        //不同进制输出
        printf("the num in 八 进 制 is:%o\n",digit);
        printf("the num in 十六进制 is:%x\n",digit);
    }
    return 0;
}