백준 6588 - Java import java.util.Scanner;public class GoldBach { public static void main(String[] args) { Scanner sc = new Scanner(System.in); final int MAX = 1000000; boolean[] isPrime = new boolean[MAX + 1]; for (int i = 2; i 백준 2024.09.21
백준 2609 - Java import java.util.Scanner;public class GCDAndLCM { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int gcd = gcd(a, b); int lcm = a * b / gcd; System.out.println(gcd); System.out.println(lcm); } // 유클리드 호제법을 이용한 최대공약수(GCD) 함수 public static int gcd(int a, int b) { .. 백준 2024.09.21
백준 11655 - Java import java.util.Arrays;import java.util.Scanner;public class SuffixArray { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String S = sc.nextLine(); String[] suffixes = new String[S.length()]; for (int i = 0; i 백준 2024.09.21
백준 10824 - Java import java.util.Scanner;public class FourNumber { public static void main(String[] args) { Scanner sc = new Scanner(System.in); // 네 개의 숫자 입력 받기 String A = sc.next(); String B = sc.next(); String C = sc.next(); String D = sc.next(); // A와 B를 붙인 수, C와 D를 붙인 수를 각각 문자열로 처리한 후, 숫자로 변환 long num1 = Long.parseLong(A + B); long num2 = Lo.. 백준 2024.09.21
백준 11655 -Java import java.io.BufferedReader;import java.io.InputStreamReader;public class ROT13 { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String input = br.readLine(); StringBuilder result = new StringBuilder(); for (int i = 0; i = 'a' && c = 'A' && c 백준 2024.09.21
백준 10820 - Java import java.io.BufferedReader;import java.io.InputStreamReader;public class StringAnalysis { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String input; while ((input = br.readLine()) != null && !input.isEmpty()) { int lowerCase = 0; int upperCase = 0; in.. 백준 2024.09.21
백준 10809 - Java import java.util.Scanner;public class CountOfAlphabet { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.nextLine(); int[] arr =new int[26]; for (int i=0; i= 'a' && c 백준 2024.09.21
백준 10808 - Java import java.util.Scanner;public class NumberOfAlphabet { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.nextLine(); int[] arr =new int[26]; for (int i=0; i= 'a' && c 백준 2024.09.21
백준 1918 - Java import java.io.BufferedReader;import java.io.InputStreamReader;import java.util.Stack;//Infix To Postfixpublic class PostOrder1 { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb = new StringBuilder(); Stack stack = new Stack(); String s = br.readLine(); for (.. 백준 2024.09.21