#include<stdio.h>
int sum(int x)
{
int s;
for( s=0 ; x>0 ; s+=x%10 , x/=10);
return s;
}
int main ()
{
printf("%d", sum(143));
}
#include<stdio.h>
int sum(int x)
{
int s;
for( s=0 ; x>0 ; s+=x%10 , x/=10);
return s;
}
int main ()
{
printf("%d", sum(143));
}