Notice
Recent Posts
Recent Comments
Link
«   2025/12   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
Tags more
Archives
Today
Total
관리 메뉴

jeongwon

[백준] 2525번 오븐 시계 본문

오늘의 문제

[백준] 2525번 오븐 시계

jeongwon_ 2022. 5. 18. 11:36

나의 답안: 

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		int h, m, t, m2;
		Scanner sc=new Scanner(System.in);
		h=sc.nextInt();
		m=sc.nextInt();
		t=sc.nextInt();
		sc.close();
		
		m2=(m+t)%60;
		h+=(m+t)/60;
		
		if(h>=24)h=h-24;	
		System.out.println(h+" "+m2);
	}
}