import java.util.Scanner;
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;
h=t/60/60; //小时
m=t/60-h*60; //分钟
}
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;
h=t/60/60; //小时
m=t/60-h*60; //分钟
s=t%60%60;//秒
System.out.println(h+":"+m+":"+s);
}}
本文提供了一个简单的Java程序,用于将总秒数转换为小时、分钟和秒的格式。通过用户输入总秒数,程序使用基本的算术运算来计算并输出对应的小时、分钟和秒。
669

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



