package jp.co.jid.conditionalBranch;

public class Exercises01 {
	private static final String AM = "AM";
	private static final String PM = "PM";
	private static final int TIME_12 = 12;
	private static final String CORON = ":";

	public static void main(String[] args) {
		int hour = 24;
		int min = 0;

		if (hour / TIME_12 > 1) {
			System.out.println("23:59までの時間を指定してください");
			return;
		}
		String hourStr = Integer.toString(hour % TIME_12);
		String minStr = String.format("%02d", min);
		String amPm = hour / TIME_12 == 0 ? AM : PM;

		System.out.println(amPm + hourStr + CORON + minStr);
	}

}
