๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๐Ÿš€ Algorithm/BOJ

2884

 

 

 

 

 

 

import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int H, M;
        H = sc.nextInt();
        M = sc.nextInt();
        
        if((M-45)<0){
            M = M + 15;
            if((H-1)<0){
                H = 23;
            }else {
                H = H-1;
            }
        }else {
            M = M - 45;
        }
        
        System.out.println(H+" "+M);
    }
}

 

'๐Ÿš€ Algorithm > BOJ' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

10952 10951  (0) 2021.08.15
2439  (0) 2021.08.15
10950  (0) 2021.08.14
2753  (0) 2021.08.12
[๋ฐฑ์ค€] 2588  (0) 2021.08.12