반응형
https://www.acmicpc.net/problem/1929
# @Author YoungMinKim
# baekjoon
import sys
import math
def isPrime(num):
if num == 1:return False
n = int(math.sqrt(num))
for i in range(2,n+1):
if num % i == 0:
return False
return True
N,M = map(int,sys.stdin.readline().split())
for i in range(N,M+1):
if isPrime(i):
print(i)
반응형
'백준 문제풀이' 카테고리의 다른 글
baekjoon - python - 1978 (0) | 2020.08.29 |
---|---|
baekjoon - python - 10039 (0) | 2020.08.29 |
baekjoon - python - 1065 (0) | 2020.08.28 |
baekjoon - python - 4673 (0) | 2020.08.28 |
baekjoon - python -2839 (0) | 2020.08.28 |
댓글