Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int h = Integer.parseInt(scanner.nextLine());
- int m = Integer.parseInt(scanner.nextLine());
- int totalM = m + 15;
- int totalH = h;
- if (totalM >= 60){
- totalH = totalH + 1;
- totalM = totalM % 60;
- }
- String minFormat = "";
- if (totalM < 10){
- minFormat = "0" + totalM;
- } else {
- minFormat = ""+totalM;
- }
- if (totalH >= 24){
- totalH = totalH - 24;
- }
- System.out.printf("%d:%s", totalH,minFormat);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement