2 solutions

  • 0
    @ 2025-4-21 3:55:55
    #include<iostream>
    using namespace std;
    int main(){
        int a=0,b=1;
        int x;
        cin >> x;
        int i=0;
        while(i<x-1){
            int c = a + b;
            a = b;
            b = c;
            i++;
        }
        cout << a << endl;
        return 0;
    }
    

    Information

    ID
    216
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    10
    Tags
    # Submissions
    4
    Accepted
    2
    Uploaded By