输入一个5位数,求每位的和
#include <stdio.h>
main()
{
int a,b,c,d,e,sum;
long num;
printf("input XXXXX number:\n");
scanf("%ld",&num);
printf("the number is:%n",num);
a=num/10000;
b=(num/1000)%10;
c=(num/100)%10;
d=(num/10)%10;
e=num%10;
printf("a=%d,b=%d,c=%d,d=%d,e=%d\n",a,b,c,d,e);
printf("\n");
sum=a+b+c+d+e;
printf("sum=%d\n",sum);
}