60分求调

P1255 数楼梯

JSYP123456 @ 2025-01-04 11:00:32

#include<bits/stdc++.h>
//using namespace std;
const int maxn=35;
long long f[maxn];
int main (){
    int n;
    scanf("%d",&n);
    if(n==0){printf("%d,0");return 0;}
    f[1]=1,f[2]=2;
    for(int i=3;i<=n;i++)
    f[i]=f[i-1]+f[i-2];
    printf("%lld",f[n]);
    return 0;  
}

by litangzheng @ 2025-01-04 11:08:22

@JSYP123456要高精度


by JSYP123456 @ 2025-01-04 11:24:22

@litangzheng大佬教教我,怎么用高精度


|