본문 바로가기

전체 글263

백준 10820 ▶ 10820문제 - 문자열 분석 ▶ 풀이방법 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)); String str = ""; //문자열 저장소 생성 while((str = br.readLine()) != null) { int lower = 0, upper = 0, num = 0, space = 0; for(int i = .. 2022. 3. 29.
백준 2133 ▶ 2133문제 - 타일 채우기 ▶ 풀이방법 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 num = Integer.parseInt(br.readLine()); int[] dp = new int[num+1]; dp[0] = 1; if(num > 1) dp[2] = 3; // 1이하일때 런타임 에러 발생하므로 1.. 2022. 3. 29.
백준 10809 ▶ 10809번 문제 - 알파벳 찾기 ▶ 풀이방법 import java.io.*; import java.util.Arrays; public class Main { public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); String str = br.readLine(); int[] arr = new int[26]; Arrays.fill(arr, -1); /*for(int i = 0; i < 26.. 2022. 3. 25.
백준 10808 ▶ 10808문제 - 알파벳 개수 ▶ 풀이방법 1. import java.io.*; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); String str = br.readLine(); char[] arr = new char[26]; int[] arr2 = new int[26]; for(int i = 0; i < 26; i++) { arr[i] = (.. 2022. 3. 25.