java

[백준] 2. 조건문 - 2480. 주사위 세개 (Java11)
문제 풀이 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 = sc.nextInt(); sc.close(); // 1. 만약 모든 변수가 다르면 int max = 0; if (a != b && b != c && a != c) { // 만약 a > b 라면 if (a > b) { // c > a > b 일때 if (c > a) { max = c; } else { max = a; } } else { // c > b > a 일때 if (c > b) {..

[백준] 2. 조건문 - 2525. 오븐 시계 (Java11)
문제 풀이 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int hour = sc.nextInt(); // 시간 int min = sc.nextInt(); // 분 int timer = sc.nextInt(); // 요리시간 sc.close(); int Min = 60*hour+min; //시 ->분 Min += timer; int Hour = (Min / 60) % 24; int minute = Min % 60; System.out.println(Hour + " " + minute); } } 알람 시계 문제에서는 주어진 시간에서 ..

[백준] 2. 조건문 - 2884. 알람 시계 (Java11)
문제 풀이 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int hour = sc.nextInt(); // 시간 int min = sc.nextInt(); // 분 sc.close(); if (min 45..