1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int H = in.nextInt(); // 시
int M = in.nextInt(); // 분
in.close();
if(M < 45) {
H--; // 시(hour) 1 감소
M= 60 - (45 - M); // 분(min) 감소
if(H < 0) {
H = 23;
}
System.out.println(H + " " + M);
}
else {
System.out.println(H + " " + (M - 45));
}
}
}
|
cs |
'Algorithm' 카테고리의 다른 글
백준 문자열 9086 (0) | 2023.08.26 |
---|---|
백준 단어 길이 재기 2743 (0) | 2023.08.26 |
백준 문자열 27866 (0) | 2023.08.24 |
백준 별 찍기 2438 (0) | 2023.08.24 |
백준 과제 안 내신 분 5597 (0) | 2023.08.24 |