<script>
let time = +prompt("请输入需要转换的秒数总数")
function getTime(x) {
let h = parseInt(x / 60 / 60 % 60)
let m = parseInt(x / 60 % 60)
let s = parseInt(x % 60)
h = h > 10 ? h : '0' + h
m = m > 10 ? m : '0' + m
s = s > 10 ? s : '0' + s
return [h, m, s]
}
let Time = getTime(time)
alert(`转换结果时:${Time[0]}时${Time[1]}分${Time[2]}秒`)
</script>