728x90
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int N = in.nextInt();
int count = 0;
int answer = 0;
for(int i=0; i<N; i++) {
int T = in.nextInt();
for(int j=2; j<T; j++) {
if(T%j==0) {
count++;
}
}
if(count ==0 && T != 1) {
answer++;
}
count=0;
}
System.out.print(answer);
}
}
728x90
728x90
'자바 > 백준 알고리즘(자바)' 카테고리의 다른 글
[백준/자바] 11653번 : 소인수분해 (0) | 2021.12.16 |
---|---|
[백준/자바] 2581번 : 소수 (0) | 2021.12.15 |
[백준/자바]5622번: 다이얼 (0) | 2021.11.15 |
[백준/자바]2908번: 상수 (0) | 2021.11.15 |
[백준/자바]1152번: 문자열 단어의 개수 공백 구분으로 세기 (0) | 2021.11.15 |