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