20250916 baekjoon
This commit is contained in:
parent
6ffec8f09c
commit
93916853da
19
code_study/Baekjoon/python/4134.py
Normal file
19
code_study/Baekjoon/python/4134.py
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
def isPrime(n: int) -> bool :
|
||||||
|
if n == 1 :
|
||||||
|
return False
|
||||||
|
if n == 2 or n == 3 :
|
||||||
|
return True
|
||||||
|
if n % 2 == 0 or n % 3 == 0 :
|
||||||
|
return False
|
||||||
|
|
||||||
|
for i in range(5,int(n**0.5)+1, 6) :
|
||||||
|
if n % i == 0 or n % (i+2) == 0 :
|
||||||
|
return False
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
|
for _ in range(int(input())) :
|
||||||
|
n: int = int(input())
|
||||||
|
while not isPrime(n) :
|
||||||
|
n += 1
|
||||||
|
print(n)
|
||||||
Loading…
x
Reference in New Issue
Block a user