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