본문 바로가기

전체 글221

[알고리즘/백준] 10809 알파벳 찾기(자바) 문제 https://www.acmicpc.net/problem/10809 풀이 코드 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int[] answer = new int[26]; Arrays.fill(answer, -1); String s = br.readLine(); .. 2021. 9. 20.
[알고리즘/백준] 9498 시험 성적 (자바) 문제 https://www.acmicpc.net/problem/9498 풀이 코드 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int score = Integer.parseInt(br.readLine()); if (score >= 90) { System.out.println("A"); } else if (score.. 2021. 9. 20.
[알고리즘/백준] 8958 OX퀴즈(자바) 문제 https://www.acmicpc.net/problem/8958 풀이 코드 public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); StringBuilder sb = new StringBuilder(); for (int i = 0; i < n; i++) { String s = br.readLine(); int sum = 0; //점수 합 int score = 1; //획득할 점수 for (char c : s.t.. 2021. 9. 20.
[알고리즘/백준] 2920 음계(자바) 문제 https://www.acmicpc.net/problem/2920 풀이 코드 public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int[] ascending = {1, 2, 3, 4, 5, 6, 7, 8}; int[] descending = {8, 7, 6, 5, 4, 3, 2, 1}; int[] arr = new int[8]; StringTokenizer st = new StringTokenizer(br.readLine()); for (int i = 0; i < 8; i++) .. 2021. 9. 19.
[알고리즘/백준] 2908 상수(자바) 문제 https://www.acmicpc.net/problem/2908 풀이 코드 StringBuilder의 reverse() 메서드를 사용하여 숫자 뒤집기 public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); int a = Integer.parseInt(st.nextToken()); int b = Integer.parseInt(st.nextToken()); int reverseA = .. 2021. 9. 19.