题解题解题解题解题解题解题解题解题解题解
2025-04-10 21:29:19
发布于:广东
15阅读
0回复
0点赞
简单,用函数做易如反掌
#include<bits/stdc++.h>
using namespace std;
int f(int n){
if(n1||n2){
return 1;
}else if(n==3){
return 2;
}
return f(n-1)+f(n-3);
}
int main(){
int n;
cin>>n;
cout<<f(n);
}
这里空空如也
有帮助,赞一个