<!DOCTYPE html
>
<html lang
="en">
<head
>
<meta charset
="UTF-8">
<meta name
="viewport" content
="width=device-width, initial-scale=1.0">
<meta http
-equiv
="X-UA-Compatible" content
="ie=edge">
<title
>水仙花
</title
>
</head
>
<body
>
<input type
="button" value
="是不是合数" onclick
="testf()" />
</body
>
</html
>
<script
>
function testf(){
for(var i
=100;i
<999;i
++){
var a
=parseInt(i
/100);
var b
=parseInt(i
/10)%10;
var c
=parseInt(i
%10);
if(i
==a
*a
*a
+b
*b
*b
+c
*c
*c
){
document
.write(i
+"<br/>")
}
}
}
</script
>
转载请注明原文地址: https://mac.8miu.com/read-495514.html