题目
如题所示
解题思路
比较简单的递归,思路有点同我之前的走楼梯问题
代码
#include <iostream>
using namespace std;
int fun(int i,int pos,int n){ //用i记录增量,用pos记录结果,估计我以后写的递归代码都会如如此了 = =
if(i==n){
return pos;
}
fun(i+1,pos*(i+1)n); //不断调用自己
}
int main(){
cout<<fun(