Advertisement
Bertran_rz

Untitled

Sep 21st, 2019
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.44 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. class Main {
  4.   public static void main(String[] args)
  5.   {
  6.     while (true)
  7.     {
  8.       Scanner in = new Scanner(System.in);
  9.       int timeSec = in.nextInt();
  10.  
  11.       int sec =  timeSec % 60;
  12.       int min =  (timeSec / 60) % 60;
  13.       int hour = (timeSec / 3600) % 24;
  14.       int day =  (timeSec / (3600*24)) % 60;
  15.       System.out.printf("%02d:%02d:%02d:%02d \n", day, hour, min, sec);
  16.      
  17.     }
  18.   }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement