19781 [Java] 백준 1978번 : 소수 찾기 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int N = in.nextInt(); int answer = 0; int[] nums = new int[N]; for (int i = 0; i < N; i++) { nums[i] = in.nextInt(); if(check(nums[i])) { answer++; } } System.out.println(answer); } static boolean check(int num) { boolean result = true; if(num < 2) { result = false; } for(i.. 2019. 9. 5. 이전 1 다음