[구름] 소수판별
소수의 정의: 1과 자기 자신을 제외한 수로 나누어지지 않는 수. 1. 2부터 n-1까지의 수를 전부 나누어 본다. (소수판별의 기본적인 방법) import java.io.*; class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String input = br.readLine(); int inputNum = Integer.parseInt(input); String output = "True"; for(int n =2; n
알고리즘문제풀이
2021. 5. 19. 13:53