// 输入: 12345 输出:一万二千三百四十五
function test(num) {
let numbers = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九']
let units = ['', '十', '百', '千']
let units2 = ['', '万', '亿', '兆', '京']
let res = ''
let loop = 0
while (num) {
let count = 0
let part = num % 10000
let partStr = ''
while (part) {
let unit = units[count]
let i = part % 10
let numberStr = numbers[i]
partStr = `${numberStr}${unit}${partStr}`
part = Math.floor(part / 10)
count++
}
res = partStr + units2[loop] + res
num = Math.floor(num / 10000)
loop++
count = 0
}
return res
}