全红
查看原帖
全红
1302444
nhsxkg楼主2024/4/19 22:25
#include<bits/stdc++.h>
using namespace std;
int n;
long long f(int x){
    if(x==1) return 1;
    if(x==2) return 1;
    return f(x-1)+f(x-2);}
int main(){
    cin>>n;
    cout<<f(n);
	return 0;
}

这题不能这么解吗?

2024/4/19 22:25
加载中...