- 1은 소수가 되지 않음
- 소수 찾을때 범위: 2~ Int(ls**0.5) 까지 수만 나누어보면 됨
n=int(input())
lst=list(map(int,input().split()))
cnt=0
for ls in lst:
if ls==1:
continue
for i in range(2,int(ls**0.5)+1):
if ls%i==0:
break
else:
cnt+=1
print(cnt)'코딩테스트 > BOJ' 카테고리의 다른 글
| [백준] 1157. 단어 공부 (0) | 2023.02.16 |
|---|---|
| [백준][DFS][순열] 14888. 연산자 끼워넣기 (0) | 2023.02.15 |
| [백준 1436] 영화감독 숌 (0) | 2023.02.11 |
| [백준 1181] 단어정렬 (0) | 2023.02.11 |
| [백준] 1049. 기타줄 - 미완 (0) | 2023.02.08 |