斐波那契数列

#include <bits/stdc++.h>
using namespace std;
int fc(int s){
	if(s<=2){
		return 1;
	}else{
		return fc(s-1)+fc(s-2);
	}
} 
int main(){
	int n;
	cin>>n;
	cout<<fc(n);
	return 0;
}

  

posted @ 2025-03-23 09:30  最后一个还有我  阅读(8)  评论(0)    收藏  举报