본문 바로가기

Algorithm/BaekJoon[Java]67

백준 11653 ▶ 백준 11653 - 소인수분해 ▶ 풀이방법 **주의 : N=1인경우 아무것도 출력하지 않음! import java.io.*; public class Main { public static void main(String[] args) throws Exception{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); int n = Integer.parseInt(br.readLine()); if(n != 1) {//n이 1일 경우 아무것도 출력하지 않음. if(n < 2) bw.write(St.. 2022. 4. 2.
백준 10872 ▶ 10872번 문제 - 팩토리얼 ▶ 풀이방법 import java.io.*; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); int n = Integer.parseInt(br.readLine()); if(n == 0) bw.write(String.valueOf(1)); else { int num = 1; for(int i = 1; i 2022. 4. 1.
백준 1929 ▶ 1929번 문제 - 소수 구하기 ▶ 풀이방법 import java.util.*; import java.io.*; public class Main{ public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); Stack stack = new Stack(); StringTokenizer st = new StringTokenizer(br.readLine()); int m = Integer.parseI.. 2022. 4. 1.
백준 1978 ▶ 1978문제 - 소수찾기 ▶ 풀이방법 import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws Exception{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); Stack stack = new Stack(); int n = Integer.parseInt(br.readLine()); StringTokenizer st = new StringTokenizer(b.. 2022. 4. 1.