Problem ID | fib |
---|---|
Difficulty level (0..10) | 2 |
Maximum runtime | 1 minute |
Original problem | |
Seen at | University of Notre Dame, 1995 Fall programming contest |
The fibonacci function is defined as follows:
f(0)=0
f(1)=1
f(n+2)=f(n+1)+f(n), n>=0
Make a program that reads non-negative integers N below 46 from the standard input and outputs the according f(N), one at a line to the standard output.
Sample input:
3 6
5
Sample output:
2
8
5