목차
1. 문제


2. 맞춘코드
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.StringTokenizer;
public class bj2525{
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine()," ");
int h, m, sum_m, total, c_h, c_m;
h = Integer.parseInt(st.nextToken());
m = Integer.parseInt(st.nextToken());
sum_m = Integer.parseInt(br.readLine());
total = h*60 + m;
total +=sum_m;
if(total>=24*60) total -= (24*60);
c_h = total/60;
c_m = total%60;
System.out.printf("%d %d", c_h, c_m);
}
}'💻 문제풀고 정리하기 + > 백준' 카테고리의 다른 글
| [백준 Java] 2739: 구구단 (0) | 2023.08.30 |
|---|---|
| [백준 Java] 2480: 주사위 세개 (0) | 2023.08.30 |
| [백준 Java] 2884: 알람 시계 (0) | 2023.08.29 |
| [백준 Java] 14681: 사분면 고르기 (0) | 2023.08.29 |
| [백준 Java] 2753: 윤년 (0) | 2023.08.29 |