Skip to content

作業3:JavaScript 基本練習 #11

Description

@ccckmit
  1. 先印出 -- Hello 你好!
  2. 印出小於 n 的所有奇數 printOdd(n)
  3. 寫一個函數判斷 n 是否為質數 isPrime(n)
  4. 印出所有小於 n 的質數總和 sumPrime(n)
  5. 寫一個函數做向量相加 vectorAdd(a,b)
  6. 寫一個函數做矩陣相加 matrixAdd(a,b)
  7. 寫一個函數做矩陣相乘 matrixMul(a,b)
  8. 請寫一個函數 daysInYear(n) 傳回西元 n 年應該有幾天
    • 例如 daysInYear(1991) => 365
    • daysInYear(2004) => 366
    • daysInYear(1900) => 365
    • daysInYear(2000) => 366 # 對 400 取餘數為 0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions