#include<iostream.h>
int main()
{
cout<<f(3)<<endl;
}
int f(int x)
{
if(x<0) return 0;
else if(x==0) return 1;
else return x*f(x-1);
}
以上是一个STACK溢出的例子.
#include<iostream.h>
int main()
{
cout<<f(3)<<endl;
}
int f(int x)
{
if(x<0) return 0;
else if(x==0) return 1;
else return x*f(x-1);
}
以上是一个STACK溢出的例子.