Untitled

mail@pastecode.io avatar
unknown
c_cpp
2 years ago
308 B
2
Indexable
Never
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>
using namespace std;

long long int a;

long long int ans(long long int num){
	if(num<=1){
		return 1;
	}
	else{
		return ans(num-1)+ans(num-2);
	}
}

int main(){
	while(scanf("%lld",&a)!=EOF && a!=-1){
		printf("%lld\n",ans(a));
	}
}