deyanivanov966

05. Time + 15 Minutes

Aug 23rd, 2020 (edited)
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.47 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Time15Minutes {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         int A = Integer.parseInt(scanner.nextLine());
  8.         int B = Integer.parseInt(scanner.nextLine());
  9.  
  10.         int C = A*60+B;
  11.         int D = C+15;
  12.  
  13.         int E = D/60;
  14.         int F = D%60;
  15.  
  16.         if(E>=24){
  17.             E=E-24;
  18.         }
  19.  
  20.         System.out.printf("%d:%02d", E , F );
  21.  
  22.     }
  23. }
  24.  
Add Comment
Please, Sign In to add comment