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 sc = new Scanner(System.in);
- int hr = Integer.parseInt(sc.nextLine());
- int mm = Integer.parseInt(sc.nextLine());
- int clockafter15min = mm + 15;
- if (clockafter15min >= 60){
- hr++;
- clockafter15min -=60;
- }
- if (hr ==24) {
- hr -= 24;
- }
- if (clockafter15min >= 10) {
- System.out.println(+hr +":" +clockafter15min);
- } else {
- System.out.println(+hr +":0" +clockafter15min);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment