Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- class TimeAfter30Minutes {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int hours = Integer.parseInt(scanner.nextLine()),
- minutes = Integer.parseInt(scanner.nextLine()),
- totalMinutes = hours * 60 + minutes + 30,
- hourTotal = totalMinutes / 60 % 24,
- minuteTotal = totalMinutes % 60;
- System.out.printf("%d:%02d", hourTotal, minuteTotal);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement