結果

問題 No.525 二度寝の季節
ユーザー gu_21816943
提出日時 2017-06-25 16:01:32
言語 Java
(openjdk 23)
結果
AC  
実行時間 155 ms / 1,000 ms
コード長 537 bytes
コンパイル時間 2,538 ms
コンパイル使用メモリ 79,824 KB
実行使用メモリ 55,140 KB
最終ジャッジ日時 2024-10-04 08:45:03
合計ジャッジ時間 7,827 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String str=sc.nextLine();
		sc.close();

		int hour=Integer.parseInt(str.substring(0,2));
		int min=Integer.parseInt(str.substring(3));
		min+=5;
		if(min>=60){
			min-=60;
			hour+=1;
			if(hour>=24){
				hour-=24;
			}
		}

		String result="";
		if(hour<10){
			result+="0"+hour;
		}else{
			result+=hour;
		}
		if(min<10){
			result+=":0"+min;
		}else{
			result+=":"+min;
		}
		System.out.println(result);
	}
}
0