Playground/자바문제집

[백준] 2884번

미숫가루설탕많이 2022. 12. 24. 13:52
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 > 자바문제집' 카테고리의 다른 글

[백준] 10950번  (0) 2022.12.25
[백준] 2525번  (0) 2022.12.25
[백준] 14681번  (0) 2022.12.24
[백준] 2753번  (0) 2022.12.24
[백준] 9498번  (0) 2022.12.24