3 条题解

  • -1
    @ 2024-4-10 16:31:08
    #include<bits/stdc++.h>
    using namespace std;
    int n;
    int a[35];
    int f(int x)
    {
    	if(x==1)
    		return 1;
    	if(x==2)
    		return 2;
    	return f(x-1)+f(x-2);
    } 
    int main()
    {
    	while(cin>>n){
    		cout<<f(n)<<endl;
    	}
    	return 0;
    }
    

    信息

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