返回列表 發帖

費式數列-使用遞迴

Write a C function Fabonacci(n) to list Fibonacci numver F,where

Fn=Fn-1+Fn-2
F1=F2=1

For example , if you enter "8" for n,it will list the results of Fn as follows:
F1=1
F2=2
F3=2
F4=3
F5=5
F6=8
F7=13
F8=21
Note:you may find solution by recursive function to solove question,please fix the question by loop and don't use recursive function this time.

本帖隱藏的內容需要回復才可以瀏覽
istak.teach2@gmail.com

返回列表