1 条题解

  • 1
    @ 2025-7-2 19:27:42
    #include<bits/stdc++.h>
    using namespace std;
    int main(){
    	long long k,a1,a2,b,s=1;
    	cin>>k;
        while(s==1){
    	if(k<=2)cout<<1;
        else if(k>=3){
        a1=1;
    	a2=1;
    	b=0;
    	for(int i=2;i<k;i++){
    		b=a1+a2;
    		a1=a2;
    		a2=b;
    	} 
    cout<<b;	 
    }
    s++;
    }
    	return 0;
    	}
    
    • 1

    信息

    ID
    342
    时间
    1000ms
    内存
    256MiB
    难度
    3
    标签
    (无)
    递交数
    39
    已通过
    24
    上传者