Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
136017 刘宸宇 斐波那契数列 C++ Accepted 2 MS 276 KB 310 2025-11-08 20:12:25

Tests(11/11):


Code:

#include<bits/stdc++.h> using namespace std; int qb(int a,int b,int c,int i){ if(i==c) return a+b; else return qb(b,a+b,c,i+1); } int main(){ int n,a=1,b=2,c=2,d,d1; cin>>n; if(n==1||n==2){ cout<<1<<endl; return 0; } cout<<qb(1,1,n,3)<<endl; return 0; }