5 solutions

  • 0
    @ 2025-2-22 11:33:50
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    int a=1,b=1,c=1;
    int n;
    cin>>n;
    for(int i=3;i<=n;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