#include <stdio.h>
main()
{
int x,sum;
int i=0;
printf("Please input an integer number: ");
scanf("%d",&x);
while(i<4)//控制在4位整数的范围
{
printf("%d\n",x%10);
sum=sum+x%10;
x=x/10;
i++;
}
printf("%d",sum);
}