60分求帮忙!!!

P1255 数楼梯

hby110 @ 2025-01-13 19:23:38

请各位大佬debug一下!!!解必关!!!

#include<iostream>
using namespace std;
long long u,m,c,n;
int main(){
    u=1,m=2;
    cin>>n;
    if(n==1){
        cout<<"1";
    }else{
        for(long long i=3;i<=n;i++){
            c=u+m,u=m,m=c;
        }
        cout<<m;
    }
    return 0;
}

by lzy120406 @ 2025-01-13 19:28:36

@hby110

1 \leq N \leq 5000

要用高精度


by hby110 @ 2025-01-13 19:29:59

@lzy120406 谢谢!!!


|