10029. fibonacci數列

I'm a slow walker, but I never walk backwards.

Task Description
輸入一個數字,表示項數,接著根據輸入項數,輸出fibonacci數列
fibonacci數列公式:
F0 = 0
F1 = 1
Fn = Fn-1 + Fn-2 , where n >= 2
Input Format
輸入一正整數
Output Format
輸出fibonacci數列,數字之間空一格,結尾不空格
Sample Input
3
Sample Output
0 1 1
Sample Input
5
Sample Output
0 1 1 2 3

Submit

Login

Testdata Set

Download Testdata