2 喜歡 0 不喜歡
222 瀏覽

          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, for example:

1,1,2,3,5,8,13,21,34,55 ..... and so on.

        Please write a program to let the users enter a number "n" and then display the sequence to the nth term.

Sample Input:

6

Sample Output:

1 1 2 3 5 8

[正常] Coding (C) - 最新提問 分類:Introduction to Computer Programming I (C) | 用戶: (20.9k 分)
ID: 21881 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 222 瀏覽
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.70.127.217
©2016-2024

相關問題

3 喜歡 0 不喜歡
0 回答
[正常] Coding (C) - 最新提問 1月 18, 2017 分類:Introduction to Computer Programming I (C) | 用戶: The Contributor (20.9k 分)
ID: 21792 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 342 瀏覽
12,783 問題
183,443 回答
172,219 留言
4,824 用戶