자바137 [백준/Java] 2525번 오븐 시계 -Code 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(); int hour = (a * 60 + b + c) / 60; int min = (a * 60 + b + c) % 60; if (hour >= 24) { hour -= 24; } System.out.println(hour + " " + min); } } 2022. 4. 16. [백준/Java] 2480번 주사위 세개 -Code import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int d1 = sc.nextInt(); int d2 = sc.nextInt(); int d3 = sc.nextInt(); if (d1 == d2 && d2 == d3 && d1 == d3){ System.out.println(10000 + d1 * 1000); } else if (d1 == d2 || d1 == d3){ System.out.println(1000 + d1 * 100); } else if (d2 == d3){ System.out.println(1000 + d2.. 2022. 4. 15. [백준/Java] 2420번 사파리월드 -Code import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long n = sc.nextLong(); long m = sc.nextLong(); System.out.println(Math.abs(n - m)); } } 2022. 4. 15. [백준/Java] 1712번 손익분기점 -Code 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(); if (b >= c){ System.out.println(-1); } else { System.out.println(a / (c - b) + 1); } } } 2022. 4. 15. [백준/Java] 1330번 두 수 비교하기 -Code 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(); if (a > b) { System.out.println(">"); } else if (a < b) { System.out.println(" 2022. 4. 15. [백준/Java] 1297번 TV 크기 -Code import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int d = sc.nextInt(); int h = sc.nextInt(); int w = sc.nextInt(); double result = d / Math.sqrt((Math.pow(h, 2) + Math.pow(w, 2))); System.out.println((int) (result * h) + " " + (int) (result * w)); } } 2022. 4. 15. 이전 1 ··· 8 9 10 11 12 13 14 ··· 23 다음