40923231 cp2020

  • Home
    • Site Map
    • reveal
    • blog
  • 首頁
  • homework1
    • PCH8 Cooling
      • Heat Sources(熱源)
      • BIOS Settings(BIOS設定)
      • Cooling Methods(冷卻方式)
      • Cooling Installation and Maintenance(冷卻安裝與維護)
      • Case Fans Installation(機箱風扇 安裝)
  • homework2
    • 2-1
    • 2-2
    • 2-3
  • homework3
    • 13 Fibonacci (費氏數列)
    • 21 Write To A File (文件編寫)
    • 35 Birthday Months(生日月份)
homework3 << Previous Next >> 21 Write To A File (文件編寫)

13 Fibonacci (費氏數列)

Exercise 13 (and Solution)

Write a program that asks the user how many Fibonnaci numbers to generate and then generates them. Take this opportunity to think about how you can use functions. Make sure to ask the user to enter the number of numbers in the sequence to generate.(Hint: The Fibonnaci seqence is a sequence of numbers where the next number in the sequence is the sum of the previous two numbers in the sequence. The sequence looks like this: 1, 1, 2, 3, 5, 8, 13, …)

編寫一個程序,詢問用戶要生成多少費氏數字,然後生成它們。 藉此機會考慮如何使用功能。 確保要求用戶輸入要生成的序列中的數字。(提示:費氏序列是一個數字序列,其中序列中的下一個數字是序列中前兩個數字的和。該序列 看起來像這樣:1、1、2、3、5、8、13…)


homework3 << Previous Next >> 21 Write To A File (文件編寫)

Copyright © All rights reserved | This template is made with by Colorlib