解题思路:
数量级较大,需要使用long类型
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
long num = scan.nextLong();
long allseconds = num / 1000;
long seconds = allseconds % 60;
long allmins = allseconds / 60;
long mins = allmins % 60;
long allhours = allmins / 60;
long hours = allhours % 24;
String date = String.format("%02d", hours) + ":" + String.format("%02d", mins) + ":" +
String.format("%02d", seconds);
System.out.println(date);
}
}