Created
October 18, 2022 07:14
-
-
Save aasumitro/b350a5b5b251bbd856f0fe870bfcab70 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.Scanner; | |
| public class Main { | |
| public static void main(String[] args) { | |
| Scanner inputDetik = new Scanner(System.in); | |
| System.out.print("Masukkan Detik: "); | |
| int detikInputan = Integer.parseInt(inputDetik.nextLine()); | |
| Main main = new Main(); | |
| String result = main.calculate(detikInputan); | |
| System.out.println(result); | |
| } | |
| private String calculate(int detikInputan) { | |
| int S = detikInputan % 60; | |
| int H = detikInputan / 60; | |
| int M = H % 60; | |
| H = H / 60; | |
| return H + ":" + M + ":" + S; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment