5 solutions

  • 0
    @ 2024-9-22 10:09:46

    #include<bits/stdc++.h> using namespace std; int main(){ int a,b,c,k; a=1,b=1,c=1; cin>>k; for(int i=3;i<=k;i++){ c=a+b; a=b; b=c; } cout<<c;

    return 0;
    

    }

    Information

    ID
    882
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    1
    Tags
    (None)
    # Submissions
    121
    Accepted
    52
    Uploaded By