题目:f(0)=1;f(n)=f(n-1)*n;
#include <iostream>
using namespace std;
int f(int n)
{
return n==0?1:f(n-1)*n;
}
int main()
{
int n;
while(cin>>n)
{
cout<<f(n)<<endl;
}
return 0;
}
题目:f(0)=1;f(n)=f(n-1)*n;
#include <iostream>
using namespace std;
int f(int n)
{
return n==0?1:f(n-1)*n;
}
int main()
{
int n;
while(cin>>n)
{
cout<<f(n)<<endl;
}
return 0;
}