#include <iostream>
using namespace std;
int sumOfEachNum(int);
int main()
{
int input;
cout<<"please input a number:";
cin>>input;
cout<<"the sum of each number is:"<<sumOfEachNum(input)<<endl;
return 0;
}
int sumOfEachNum(int a)
{
int sum =0 ;
do
{
sum += a%10;
a /= 10;
}while(a != 0);
return sum;
}