代码如下:include <stdio.h> int main(){ int num,num1,sum=0,i;printf("输入一个整数:");scanf("%d",&num);num1=num;while (i>0){ i=num%10;sum+=i;num=(num-i)/10;} printf("%d各位上的和为:%d\n",num1,sum);return 0;} ...