打印水仙花数(三位数),(153=1*1*1+5*5*5+3*3*3)每位数字的立方和等于等于该数即水仙花数,打印出所有水仙花数
function text1() { for (let d = 100; d <= 999; d++) { let a = parseInt(d / 100); let b = parseInt(d / 10) % 10; let c = d % 10; if (a * a * a + b * b * b + c * c * c == d) { document.write(d + '<br>') } } }