#includeint fun(int n){int s=0;while(n) {s+=n%10;n=n/10;}return s;}main(){int n;scanf("%d",&n);printf("%d\n",fun(n));} 请采纳