소수 : 1보다 큰 자연수 중 1과 자기 자신만을 약수로 가지는 수
def find(num):
for i in range(2, num):
if num % i == 0:
return 0
if num == 1:
return 0
N = int(input())
M = list(map(int, input().split()))
count = 0
for i in range(N):
if find(M[i]) != 0:
count += 1
print(count)
'백준 > 약수, 배수와 소수' 카테고리의 다른 글
백준 - 11653 (python) (0) | 2024.02.29 |
---|---|
백준 - 2581 (python) (0) | 2024.02.27 |
백준 - 9506 (python) (0) | 2024.02.22 |
백준 - 2501 (python) (0) | 2024.02.22 |
백준 - 5086 (python) (0) | 2024.02.21 |