1277: Fibonacci Freeze
| Result | TIME Limit | MEMORY Limit | Run Times | AC Times | JUDGE |
|---|---|---|---|---|---|
| 3s | 8192K | 2332 | 552 | Standard |
The Fibonacci numbers (0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, ...) are defined by the recurrence:
Write a program to calculate the Fibonacci Numbers.
Input and Output
The input to your program would be a sequence of numbers smaller or equal than 500, each on a separate line, specifying which Fibonacci number to calculate.
Your program should output the Fibonacci number for each input value, one per line.
Sample Input
5 7 11
Sample Output
The Fibonacci number for 5 is 5 The Fibonacci number for 7 is 13 The Fibonacci number for 11 is 89
This problem is used for contest: 111
Submit / Problem List / Status / Discuss
本文介绍了一个计算斐波那契数列的程序实现,输入为一系列不大于500的整数,输出对应的斐波那契数值。示例展示了输入5、7、11时,输出分别为5、13、89。
878

被折叠的 条评论
为什么被折叠?



