본문 바로가기

Beakjoon&프로그래머스/Java139

[백준/Java] 5537번 웰컴 -코드 public class Main { public static void main(String[] args) { System.out.println(". . ."); System.out.println("| | _ | _. _ ._ _ _"); System.out.println("|/\\|(/.|(_.(_)[ | )(/."); } } 2022. 4. 10.
[백준/Java] 3046번 R2 -코드 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int r1 = sc.nextInt(); int s = sc.nextInt(); System.out.println(s * 2 - r1); } } 2022. 4. 10.
[백준/Java] 3003번 킹, 퀸, 룩, 비숍, 나이트, 폰 -코드 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[] chess = {1, 1, 2, 2, 2, 8}; int[] myChess = new int[6]; int n; for (int i = 0; i < chess.length; i++) { myChess[i] = sc.nextInt(); } for (int i = 0; i < chess.length; i++) { n = chess[i] - myChess[i]; System.out.print(n + " "); } } } 2022. 4. 10.
[백준/Java] 2914번 저작권 -코드 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int i = sc.nextInt(); System.out.println(a * (i - 1) + 1); } } 2022. 4. 10.
[백준/Java] 2845번 파티가 끝나고 난 뒤 -코드 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int l = sc.nextInt(); int p = sc.nextInt(); int[] arr = new int[5]; int[] result = new int[5]; for (int i = 0; i < arr.length; i++) { arr[i] = sc.nextInt(); } for (int i = 0; i < arr.length; i++) { result[i] = arr[i] - (l * p); } for(int i : result) { System.out.print(i.. 2022. 4. 10.
[백준/Java] 2558번 A+B - 2 -코드 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); System.out.println(a + b); } } 2022. 4. 9.