[백준] 2884번 : 알람 시계 - Java(자바)

강재원·2022년 10월 4일
0

[코딩테스트] Java

목록 보기
91/200



https://www.acmicpc.net/problem/2884

import java.util.*;
public class Main {
    public static void main(String args[]) {
        Scanner s=new Scanner(System.in);
        int h=s.nextInt();
        int m=s.nextInt();
        m-=45;
        if(m<0){
            h--;
            m+=60;
        }
        if(h<0) h=23;
        System.out.format("%d %d",h,m);
    }
}
profile
개념정리 & 문법 정리 & 알고리즘 공부

0개의 댓글