BOJ1978-소수 찾기 (python3)

Ok Haeeun·2023년 3월 31일
0

Python3로 algorithm문풀

목록 보기
39/53

쉬웠다!

import sys

n = int(sys.stdin.readline().rstrip('\n'))
n_list = list(map(int,sys.stdin.readline().rstrip('\n').split()))
isPrime = True
result = 0
for i in n_list:
    isPrime = True
    for j in range(2,i):
        if i%j == 0:
            isPrime = False
            break
    if i!=1 and isPrime: result += 1

print(result)
profile
tistory에 이어서 기록합니다 👉 https://i-m-okay.tistory.com/

0개의 댓글

관련 채용 정보