#include <槐袜卜stdio.h>好耐int main(){int n,sum=0;printf("铅穗请输入一个整数:");scanf("%d",&n);while(n){sum = sum+n%10;n /= 10;}printf("%d",sum);}