ZhivkoPetkov

Time + 15 Minutes

Feb 19th, 2018
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.65 KB | None | 0 0
  1. package com.company;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Main {
  6.  
  7.     public static void main(String[] args) {
  8.         Scanner sc = new Scanner(System.in);
  9.         int hr = Integer.parseInt(sc.nextLine());
  10.         int mm = Integer.parseInt(sc.nextLine());
  11.         int clockafter15min = mm + 15;
  12.         if (clockafter15min >= 60){
  13.             hr++;
  14.             clockafter15min -=60;
  15.         }
  16.  
  17.         if (hr ==24) {
  18.             hr -= 24;
  19.         }
  20.  
  21.         if (clockafter15min >= 10) {
  22.             System.out.println(+hr +":" +clockafter15min);
  23.         } else {
  24.             System.out.println(+hr +":0" +clockafter15min);
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment