题解 | #时间转换#
时间转换
https://www.nowcoder.com/practice/c4ae7bcac7f9491b8be82ee516a94899
const rl = require("readline").createInterface({ input: process.stdin });
var iter = rl[Symbol.asyncIterator]();
const readline = async () => (await iter.next()).value;
void async function () {
// Write your code here
while(line = await readline()){
let tokens = line.split(' ');
let a = parseInt(tokens[0]);
// let b = parseInt(tokens[1]);
let h = parseInt(a/3600)
let m = parseInt(a/60-h*60)
let s = parseInt(a%60)
console.log(h+" "+m+" "+s+"");
}
}()
查看4道真题和解析
