看不明白此程序的运行过程,希望有人可以帮忙看看,讲解一下,谢谢!
int f(int a,int b){
if(a>b)return b+a;else b*f(++a,b--);
return a*f(a,b);
}
int main(){
cout<<f(1,3)<<endl;
system("pause");
return 0;
}
运行结果为24。
看不明白此程序的运行过程,希望有人可以帮忙看看,讲解一下,谢谢!
int f(int a,int b){
if(a>b)return b+a;else b*f(++a,b--);
return a*f(a,b);
}
int main(){
cout<<f(1,3)<<endl;
system("pause");
return 0;
}
运行结果为24。