13061 - Fibonacci Sequence   

Description

The Fibonacci sequence is a sequence where the next term is the sum of the previous two terms. The first two terms of the Fibonacci sequence are 0 followed by 1.

 

For example,

 

We have provided the partial judge code (13061.c) below for you.

All you need to do is complete the int fib(int n) function and submit it to NTHU Online Judge System.

int fib(int n){

             ...

             ...

}

 

Attention: Using recursion to solve this problem.

 

Input

Given an integer n, where n >= 0

 

Output

Print out the F0 to Fn

 

Sample Input  Download

Sample Output  Download

Partial Judge Code

13061.c

Partial Judge Header

13061.h

Tags




Discuss