Prime number-Smple


Submit solution

Points: 100 (partial)
Time limit: 1.0s
Memory limit: 64M

Authors:
Problem type

題目說明

請輸入一個整數n,判斷其是否為質數。
如果是質數請輸出true,不是則輸出所有因數。

質數定義:因數只有1和自己,例如:
5 >> 1、5
7 >> 1、7

輸入

整數n (n > 0)

輸出

是質數則輸出 >> true
不是質數則輸出 >> n的所有因數

範例輸入1

3

範例輸出1

true

範例輸入2

18

範例輸出2

1
2
3
6
9
18

範例輸入3

169

範例輸出3

1
13
169

Comments

There are no comments at the moment.