first commit
This commit is contained in:
parent
abc6526143
commit
26631f9b48
24 changed files with 1089 additions and 1 deletions
10
Exercise/exercise-5.1.py
Normal file
10
Exercise/exercise-5.1.py
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
# 我们来输出100以内的素数
|
||||
|
||||
def is_prime(n):
|
||||
# 检查n是否是素数,一个简易的办法是,遍历小于n的自然数,判断是否有自然数可以整除n
|
||||
return False
|
||||
|
||||
|
||||
for i in range(100):
|
||||
# 遍历100以内的自然数,检查他们是不是素数,并输出其中的素数
|
||||
result = is_prime(i)
|
||||
Loading…
Add table
Add a link
Reference in a new issue