题解 | #时间转换#
时间转换
http://www.nowcoder.com/practice/c4ae7bcac7f9491b8be82ee516a94899
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
long n = scan.nextLong(); // 输入秒数
// 小时
long xs = n / 3600 % 24;
// 分钟
long fz = n / 60 % 60;
// 秒数
long ms = n % 60;
System.out.println(xs + " " + fz + " " + ms);
}
}
查看13道真题和解析