参考代码:
import java.util.Scanner; public class Main { public static void main(String[] args) { int s = new Scanner(System.in).nextInt(); Time time = new Time(); time.Set(s); time.Display(); } } class Time { private int h, m, s; public void Set(int seconds) { h = seconds / 3600; m = seconds % 3600 / 60; s = seconds % 60; } public void Display() { System.out.printf("%d:%d:%d", h, m, s); } }
0.0分
6 人评分