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