int sum(int a);
int mul(int b);
int mod(int c);
int main(int argc, const char *argv[])
{
int a;
scanf("%d",&a);
int h=sum(a);
printf("h=%d\n",h);//+
int b=5;
int j=mul(b);
printf("j+%d\n",j);//b!
int c=1234;
int m=mod(c);//递归计算数字和 1234=1+2+3+4
printf("m=%d\n",m);
return 0;
}
int sum(int a)
{
if(a==0)
return 0;
else
return a+sum(a-1);
}
int mul(int b)
{
if(b==0)
return 1;
else
return b*mul(b-1);
}
int mod(int c)
{
if(c==0)
return 0;
else
return c%10+mod(c/10);
}