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