[1055]斐波那契 -- HPU Online Judge

1055: 斐波那契 [水题]

时间限制: 1 Sec 内存限制: 128 MB

提交: 296 解决: 122 统计

题目描述

Do you know the Fibonacci sequence?

In mathematics, the Fibonacci numbers are the numbers in the following integer sequence, called the Fibonacci sequence, and characterized by the fact that every number after the first two is the sum of the two preceding ones:

1、1、2、3、5、8、13、21……

The sequence Fn of Fibonacci numbers is defined by the recurrence relation:

$$F_n = F_{n-1} + F_{n-2}$$

Give you a positive integer $n$,I want to know $F_n$.

输入

Input includes multiple cases.

Each line is a positive integer $n$.

$(0 < n < 40)$

输出

For each case:

Print a integer number in a line, is the $F_n$.

样例输入

2
3
4

样例输出

1
2
3

来源

BoilTask
提交讨论