본문 바로가기

코딩 테스트/백준

(54)
[백준 1085번 문제, JAVA] 직사각형에서 탈출 문제 코드 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.Collections; import java.util.List; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] input = br.readLine().split(" "); int x = Integer.parseInt..
[백준 1004번 문제, JAVA] 어린 왕자 문제 코드 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); List answerList = new ArrayList(); int n = Integer.parseInt(br.readLine()); for (int i = 0; i ..
[백준 1001번 문제, JAVA] A-B 문제 코드 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); String[] input = reader.readLine().split(" "); System.out.println(Integer.parseInt(input[0]) - Integer.parseInt(input[1])); } } 해결 참고 https:/..
[백준 1000번 문제, JAVA] A+B 문제 코드 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); String[] input = reader.readLine().split(" "); System.out.println(Integer.parseInt(input[0]) + Integer.parseInt(input[1])); } } 해결 입력 받고 더하면 ..
[백준 1075번 문제, JAVA] 나누기 문제 코드 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(reader.readLine()); n = n - n % 100; int f = Integer.parseInt(reader.readLine()); while (true) { if (n % f == 0) { S..
[백준 1002번 문제, JAVA] 터렛 문제 코드 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; public class Main { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(reader.readLine()); List answers = new ArrayList(); for (int i = 0; i < n; i++) { String[] token..