Submission

Status:

PPPPP-----

Subtask/Task Score:

50/100

Score: 50

User: tl.cpp

Problemset: อนุกรม

Language: cpp

Time: 0.004 second

Submitted On: 2026-07-31 23:16:21

#include <bits/stdc++.h>
using namespace std;
const int N = 110;
int n, a[N];
int main() {
    ios::sync_with_stdio(0), cin.tie(0);

    cin >> n;
    a[1] = a[2] = 1;
    for (int i = 3; i <= n; i++) {
        a[i] = a[i - 1] + a[i - 2];
    }
    cout << a[n];
}