void main(){int x;int i=0;int sum=0;char a[10];int index=0;printf("请输入!\r\n");scanf("%d",&x);while(x){a[index]=x%10;x=x/10;index++;}printf("整数共%d位",index);for(;i{sum+=a[i];}printf("数字的和为%d\r\n",sum);}