关于c语言函数递归中return的返回值的问题
#include<stdio.h>int main()
{int age(int n);
printf("no.5,age:%d\n",age(5));
return 0;}
int age(int n)
{int c;
if(n==1)
c=10;
else
c=age(n-1)+2;
return c;
}
返回时,是返回主函数还是返回c=age(n-1)+2,是不是调用多少次就返回多少次?为什么?
2011-12-21 18:01
2011-12-21 21:23
2011-12-22 09:19