#include"stdio.h" int main() { int n,t,s; s=0; scanf("%d",&n); while(n!=0) { t=n%10; s=s+t; n=n/10; } printf("各位数字之和为%d",s); }