[백준] 1929번 : 소수 구하기 - Python(파이썬)

강재원·2022년 11월 10일
0

[코딩테스트] Python

목록 보기
172/200



https://www.acmicpc.net/problem/1929

import math
m,n=map(int,input().split())
for i in range(m,n+1):
    k=0
    if i==1: k=1
    for j in range(2,int(math.sqrt(i))+1):
        if i%j==0:
            k=1
            break
    if k==0:
        print(i)
profile
개념정리 & 문법 정리 & 알고리즘 공부

0개의 댓글