[Login|Register]
Problems

Status

Rank

Problem 1331
Fibonacci Numbers
Time Limit: 1000ms
Memory Limit: 65536kb
Description
A Fibonacci sequence is calculated by adding the previous two members of the sequence, with the first two members being both 1. f (1) = 1, f (2) = 1, f (n > 2) = f (n - 1) + f (n - 2)
Input
Take numbers as input (one per line),the input end with 0 , you need not calculated the last line.
Output
For each input ,print the corresponding Fibonacci number.
Sample Input
3
100
0
Sample Output
2
354224848179261915075
University of Science and Technology of China
Online Judge for ACM/ICPC
Processed in 1.7ms with 1 query(s).