import java.util.Scanner;
import java.util.prefs.BackingStoreException;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
int h = 0 ;
int m = 0 ;
int s = 0 ;
while(true){
if( t >= 3600 ){
t -= 3600;
h++;
}else if( t >= 60 ){
t -=60;
m++;
}else{
s = t ;
break;
}
}
System.out.println(h+":"+m+":"+s);
}
}时间转换
最新推荐文章于 2018-09-16 00:18:06 发布
本文介绍了一个简单的Java程序,该程序接收一个表示秒数的整数输入,并将其转换为小时、分钟和秒的格式。通过使用循环和条件判断,程序能够准确地将总秒数分解为更易于理解的时间单位。
2378

被折叠的 条评论
为什么被折叠?



