Submission

Status:

PPPPPTTTTT

Subtask/Task Score:

50/100

Score: 50

User: cyblox_boi

Problemset: อนุกรม

Language: cpp

Time: 1.095 second

Submitted On: 2025-10-16 09:54:28

#include <iostream>
using namespace std;

int fib(int n)
{
    if (n <= 2)
    {
        return 1;
    }
    else
    {
        return fib(n - 1) + fib(n - 2);
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n;
    cin >> n;

    cout << fib(n) << '\n';

    return 0;
}