B2214shengmin @ 2022-06-26 21:59:58
#include<bits/stdc++.h>
using namespace std;
long long fbnqsl(int x){
if(x==1)return 1;
else if(x==2)return 2;
else return fbnqsl(x-1)+fbnqsl(x-2);
}
int main() {
int k;
cin>>k;
cout<<fbnqsl(k);
return 0;
}
by rzh123 @ 2022-06-26 22:01:00
没用高精度
by B2214shengmin @ 2022-06-26 22:01:05
这个也用了递归了呀!
by B2214shengmin @ 2022-06-26 22:01:44
@rzh123 哪怎么改呢?
by sxr426 @ 2022-06-26 22:01:47
@B2214shengmin 你忘写高精了
by rzh123 @ 2022-06-26 22:02:17
@B2214shengmin 高精度,用数组模拟列竖式计算
by rzh123 @ 2022-06-26 22:02:55
by B2214shengmin @ 2022-06-26 22:03:44
@rzh123 e...不会[苦笑]
by rzh123 @ 2022-06-26 22:04:35
@B2214shengmin 不会可以先看 https://www.luogu.com.cn/problem/P1601
by B2214shengmin @ 2022-06-26 22:04:45
@rzh123 是还要搞个函数吗?
by rzh123 @ 2022-06-26 22:05:40
是