Submission

Status:

PPPPPTTTTT

Subtask/Task Score:

50/100

Score: 50

User: Gundhon

Problemset: อนุกรม

Language: cpp

Time: 1.098 second

Submitted On: 2026-10-01 21:39:51

#include <bits/stdc++.h>

using namespace std;
int fibonacci(int n){
    if (n <= 1) return 1;
    else{
        return fibonacci(n-1) + fibonacci(n-2); // fibonacci formula
    }
}

int main(){
    int c;
    cin >> c;
    bool o = true;
    if(c > 90){
        o = false;
    }
    
    if(o) cout << fibonacci(c-1);

    return 0;
}