#include void main(){ int sum=0,n; printf("please input n:"); scanf("%d",&n); while(n) { sum+=n%10; n/=10; } printf("sum=%d\n",sum);} //不懂,追问