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 minute = Integer.parseInt(scanner.nextLine());
- int totalMinutes = hour * 60 + minute + 15;
- int hours = totalMinutes / 60 % 24;
- int minutes = totalMinutes % 60;
- System.out.printf("%d:%02d", hours, minutes);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement