• 沒有找到結果。

The Fibonacci numbers (0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, ...) are defined by the recurrence:

N/A
N/A
Protected

Academic year: 2021

Share "The Fibonacci numbers (0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, ...) are defined by the recurrence:"

Copied!
1
0
0

加載中.... (立即查看全文)

全文

(1)

495 Fibonacci Freeze

The Fibonacci numbers (0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, ...) are defined by the recurrence:

F

0

= 0 F

1

= 1

F

i

= F

i−1

+ F

i−2

for all i ≥ 2 Write a program to calculate the Fibonacci Numbers.

Input

The input to your program would be a sequence of numbers smaller or equal than 5000, each on a separate line, specifying which Fibonacci number to calculate.

Output

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

參考文獻

相關文件

EQUIPAMENTO SOCIAL A CARGO DO INSTITUTO DE ACÇÃO SOCIAL, Nº DE UTENTES E PESSOAL SOCIAL SERVICE FACILITIES OF SOCIAL WELFARE BUREAU, NUMBER OF USERS AND STAFF. 數目 N o

INFORMAÇÃO GLOBAL SOBRE AS ASSOCIAÇÕES DE SOLIDARIEDADE SOCIAL E OS SERVIÇOS SUBSIDIADOS REGULARMENTE PELO INSTITUTO DE ACÇÃO SOCIAL. STATISTICS ON SOCIAL SOLIDARITY ASSOCIATIONS

Valor acrescentado bruto : Receitas mais variação de existências, menos compras de bens e serviços para revenda, menos comissões pagas, menos despesas de exploração. Excedente

Valor acrescentado bruto : Receitas do jogo e dos serviços relacionados menos compras de bens e serviços para venda, menos comissões pagas menos despesas de

Valor acrescentado bruto : Receitas do jogo e dos serviços relacionados menos compras de bens e serviços para venda, menos comissões pagas menos despesas de

依獎懲及 法定程序 予以書面 懲處 暫時讓學 生與其他 同學保持 距離..

第二級失能 生活補助金 滿第一年 15萬元 11.25萬元 滿第二年 20萬元 15.00萬元 滿第三年 25萬元 18.75萬元 滿第四年 30萬元

Then, it is easy to see that there are 9 problems for which the iterative numbers of the algorithm using ψ α,θ,p in the case of θ = 1 and p = 3 are less than the one of the