4 条题解

  • 0
    @ 2025-2-24 21:27:00
    #include<bits/stdc++.h>
    using namespace std;
    int fbnq(int n){
    	if(n==1){
    		return 1;
    	}else if(n==2){
    		return 2;
    	}else{
    		return fbnq(n-1)+fbnq(n-2);
    	}
    }
    int main(){
    	int num;
    	while(cin>>num)	cout<<fbnq(num)<<endl;
    	return 0;
    }
    
    
    
    

    信息

    ID
    1369
    时间
    1000ms
    内存
    128MiB
    难度
    2
    标签
    (无)
    递交数
    81
    已通过
    53
    上传者