結果

問題 No.525 二度寝の季節
ユーザー Amanita2016
提出日時 2017-06-27 17:10:59
言語 Java
(openjdk 23)
結果
AC  
実行時間 175 ms / 1,000 ms
コード長 610 bytes
コンパイル時間 1,980 ms
コンパイル使用メモリ 76,552 KB
実行使用メモリ 55,672 KB
最終ジャッジ日時 2024-10-04 11:38:18
合計ジャッジ時間 8,705 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner sc =  new Scanner(System.in);
		String moment = sc.nextLine();
		String[] spl = moment.split(":");
		int hour = Integer.parseInt(spl[0]);
		int minu = Integer.parseInt(spl[1]);
		minu+=5;
		if(minu >= 60){
			minu-=60;
			hour++;
		}
		hour%=24;
		String[] prefix = {"",""};
		if(hour < 10){
			prefix[0] = "0";
		}
		if(minu < 10){
			prefix[1] = "0";
		}
		System.out.println(prefix[0] + hour + ":" + prefix[1] + minu);
	}

}
0