알람시계
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();
if(M<45) {
if(H==0) H=23;
else H-=1;
System.out.println(H+" "+(60+M-45));
}
else if(M>=45)
System.out.println(H+" "+(M-45));
sc.close();
}
}
'PROGRAMMING CODE > JAVA' 카테고리의 다른 글
[BAEKJOON] No.2522 JAVA (0) | 2021.10.14 |
---|---|
[BAEKJOON] No.2446 JAVA (0) | 2021.10.14 |
[BAEKJOON] No.2445 JAVA (0) | 2021.10.14 |
[BAEKJOON] No.2444 JAVA (0) | 2021.10.14 |
[BAEKJOON] No.1000 JAVA (0) | 2021.10.14 |