Submission
Status:
PPPPPTTTTT
Subtask/Task Score:
50/100
Score: 50
User: pann
Problemset: อนุกรม
Language: cpp
Time: 1.092 second
Submitted On: 2026-10-02 06:02:21
#include <iostream>
using namespace std;
int ans(int x){
if (x == 0) return 0;
if (x == 1) return 1;
return ans(x-1) + ans(x-2);
}
int main(){
int n;
cin >> n;
cout << ans(n);
return 0;
}