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 scan = new Scanner(System.in);
- int hour = Integer.parseInt(scan.nextLine());
- int minutes = Integer.parseInt(scan.nextLine());
- if (minutes < 60) {
- minutes = minutes + 15;
- int mins = minutes % 60;
- if (minutes >= 60) {
- hour = hour + 1;
- }
- if (hour > 23) {
- hour = 0;
- }
- if (mins <= 9) {
- System.out.printf("%d:0%d", hour, mins);
- } else {
- System.out.printf("%d:%d", hour, mins);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement