随手写一写 不喜勿喷
1.函数引用的时候比如需要写
var myfun=newQuestion;
而不是
var myfun=newQuestion();
这个小括号是不能加的
2. web 水仙花数
<script>
function water() {
var a, b, c, d;
var txt = "";
for (var i = 100; i < 1000; i++) {
a = i % 10;
b = Math.floor(i % 100 / 10);
c = Math.floor(i / 100);
d = a * a * a + b * b * b + c * c * c;
if (d == i)
txt+=d+"<br>";
};
return txt;
}
</script>
3.web里的数有时候不能相乘相加需要
c=Number(a)+Number(b);