3 solutions

  • 2
    @ 2024-3-24 10:06:34
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
        long long a,b,c;
        c=1,a=1,b=1;
        int n;
        cin>>n;
        for(int i =3;i<=n+1;i++)
        {
            c=a+b;
            a=b;
            b=c;
        }
        cout<<c;
        return 0;
    }
    //😅😅😅😅😅😅😅😅😅
    

    Information

    ID
    1257
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    1
    Tags
    (None)
    # Submissions
    69
    Accepted
    31
    Uploaded By