foo.c: In function 'main':
foo.c:6:10: error: expected declaration specifiers or '...' before string constant
printf("请输入数字正整数\n");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
foo.c:7:14: error: 'x' undeclared (first use in this function)
scanf("%d",&x);
^
foo.c:7:14: note: each undeclared identifier is reported only once for each function it appears in
foo.c:10:3: error: 'a' undeclared (first use in this function)
a[i]=x%10;
^
foo.c:10:5: error: 'i' undeclared (first use in this function)
a[i]=x%10;
^
foo.c:11:3: error: 'sum' undeclared (first use in this function)
sum=sum*10+a[i];
^~~
[Hydro](https://hydro.ac)提供评测服务