输入样例:
123 4577973
输出样例:
12:42:59
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
float C1 = sc.nextFloat();
float C2 = sc.nextFloat();
float d = C2-C1;
float t = d/100;
int h = (int) (t/3600);
t -= (h*3600);
int m = (int) (t/60);
t -= (m*60);
t *= 10;
t += 5;
t /= 10;
int sec = 0;
sec = (int) t;
if (h < 10) {
System.out.printf("0%d:",h);
}else {
System.out.printf("%d:",h);
}
if (m < 10) {
System.out.printf("0%d:",m);
}else {
System.out.printf("%d:",m);
}
if (sec < 10) {
System.out.printf("0%d",sec);
}else {
System.out.printf("%d",sec);
}
}
}