Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: anonymous
Problemset: Fibonacci Croissant
Language: cpp
Time: 0.003 second
Submitted On: 2026-10-21 18:00:07
#include <bits/stdc++.h>
using namespace std;
long long fib(long long a,long long b,long long n){
if(n == 0) return 0;
return a + fib(b,a+b,n-1);
}
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
long long n; cin >> n;
cout << fib(0,1,n+1);
}