#include#includeint main(){int x,i,j,k,sum; printf("请输入一个三位正整数:"); scanf("%d",&x); i=x%10; j=(x/10)%10; k=(x/100)%10; sum=i+j+k; printf("各位之和=%d\n",sum); system("pause"); }