求阶乘
来源:互联网 发布:学校网络缴费app 编辑:程序博客网 时间:2024/05/17 08:42
#include <iostream>
using namespace std;
int fib(int n);
int main()
{
cout<<fib(5)<<endl;
return 0;
}
int fib(int n)
{
if(n==1)
return 1;
if(n>1)
{
return n*fib(n-1);
}
}
using namespace std;
int fib(int n);
int main()
{
cout<<fib(5)<<endl;
return 0;
}
int fib(int n)
{
if(n==1)
return 1;
if(n>1)
{
return n*fib(n-1);
}
}
0 0