题目描述
Find all prime number within N.
输入
N
输出
Prime number from 0 to N (test data guarantees 0~N presence of prime numbers)
样例输入 Copy
100
样例输出 Copy
2
3
5
7
11
13
17
19
23
29
31
37
41
43
47
53
59
61
67
71
73
79
83
89
97
提示
What is a prime number?
n=int(input())
flag=0
for i in range(2,n):
flag=0
for j in range(2,i):
if(i%j==0):
flag=1
if(flag==0):
print('%d'%i)