[백준] 8393번 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int A = sc.nextInt(); int sum = 0; for (int i = 1; i Playground/자바문제집 2022.12.25
[백준] 10950번 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int A = sc.nextInt(); // 몇 번 수행할 것인지 for (int i = 0; i < A; i++) { int B = sc.nextInt(); int C = sc.nextInt(); System.out.println(B + C); } } } Playground/자바문제집 2022.12.25
[백준] 2525번 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int H = sc.nextInt(); // 시 int M = sc.nextInt(); // 분 int A = sc.nextInt(); // 요리에 필요한 시간 sc.close(); H += (A / 60); M += (A % 60); if (M > 59) { H++; M -= 60; } if (H > 23) { H -= 24; } System.out.println(H + " " + M); } } Playground/자바문제집 2022.12.25
[백준] 2884번 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int H = sc.nextInt(); int M = sc.nextInt(); sc.close(); if (M < 45) { H--; M = 15 + M; if (H < 0) H = 23; System.out.println(H + " " + M); } else System.out.println(H + " " + (M - 45)); } } Playground/자바문제집 2022.12.24
[백준] 14681번 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int X = sc.nextInt(); int Y = sc.nextInt(); sc.close(); if (X > 0 && Y > 0) System.out.println(1); else if (X 0) System.out.println(2); else if (X < 0 && Y < 0) System.out.println(3); else System.out.println(4); } } Playground/자바문제집 2022.12.24
[백준] 2753번 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int year = sc.nextInt(); sc.close(); if (year % 4 == 0) { if (year % 400 == 0) System.out.println(1); else if (year % 100 == 0) System.out.println(0); else System.out.println(1); } else System.out.println(0); } } Playground/자바문제집 2022.12.24
[백준] 9498번 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int A = sc.nextInt(); sc.close(); if (A >= 90) System.out.println('A'); else if (A >=80) System.out.println('B'); else if (A >=70) System.out.println('C'); else if (A >=60) System.out.println('D'); else System.out.println('F'); } } Playground/자바문제집 2022.12.24
[백준] 1330번 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(); sc.close(); if (A > B) { System.out.println(">"); } else if (A < B) { System.out.println(" Playground/자바문제집 2022.12.24
[백준] 2588번 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(); int c = (b % 10) * a; int d = (b % 100)/10 * a; int e = (b/100) * a; System.out.println(c); System.out.println(d); System.out.println(e); System.out.println(a * b); sc.close(); } } Playground/자바문제집 2022.12.24
[백준] 25083번 public class Main { public static void main(String[] args) { System.out.println(" ,r'\"7"); System.out.println("r`-_ ,' ,/"); System.out.println(" \\. \". L_r'"); System.out.println(" `~\\/"); System.out.println(" |"); System.out.println(" |"); } } Playground/자바문제집 2022.12.24