Day 1 Question 1

Fibonacci Numbers

Input file: fib.in

Output file: fib.out

The nth Fibonacci number, f(n), is defined thus:

f(1) = 1
f(2) = 1
f(n) = f(n-1) + f(n-2) [for all n > 2]

Write a program that reads several n, one per line, and writes the corresponding f(n), one per line. Each value of n will be between 1 and 200. The last line of input contains 0.

Sample input

1
2
3
4
5
100
0

Output for sample input

1
1
2
3
5
354224848179261915075