-
2884번: 알람 시계코테/백준 2024. 5. 6. 16:04

import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int hr = sc.nextInt(); // 시 int Min = sc.nextInt(); // 분 if(Min < 45) { hr--; // 시간1 감소 (45 분보다 적기 때문) Min= 60 - (45 - Min); // 분 45 감소 if(hr < 0) { hr = 23; } System.out.println(hr + " " + Min); } else { // 45 분 이상이면 시간을 건드릴 필요가 없음 System.out.println(hr + " " + (Min - 45)); } } }'코테 > 백준' 카테고리의 다른 글
8393번: 합 (0) 2024.05.14 10950번: A+B - 3 (0) 2024.05.10 2739번: 구구단 (0) 2024.05.09 2480번: 주사위 세개 (0) 2024.05.08 2525번: 오븐 시계 (1) 2024.05.07