169. 費式數列遞迴版

 avatar
user_6817964
c_cpp
2 years ago
209 B
0
Indexable
Never
int fibr(int n);

int fibr(int n) {
	if (n == 0 || n == 1) {
		return 1;
	}
	else {
		return fibr(n - 1) + fibr(n - 2);
	}
}

int main() {
	int n;
	scanf("%d", &n);
	printf("%d", fibr(n));

}