Submission
Status:
PPPPPTTTTT
Subtask/Task Score:
50/100
Score: 50
User: Gundhon
Problemset: อนุกรม
Language: cpp
Time: 1.096 second
Submitted On: 2026-10-01 21:37:18
#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;
cout << fibonacci(c-1);
return 0;
}