当前位置:网站首页>JS find the number of all daffodils
JS find the number of all daffodils
2022-06-27 07:35:00 【I am the sun?】
Code :
<!DOCTYPE html>
<html lang="zh">
<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>js Count all daffodils </title>
<script type="text/javascript">
for(var i = 100;i <= 999;i++){
// bits
var a = i % 10;
// ten , because / Accounting to the decimal point , So round it up
var b = parseInt(i% 100 / 10);
// Hundred bit ditto , It is also because / , So round it up
var c =parseInt(i / 100);
if((a*a*a + b*b*b + c*c*c) ==i)
console.log(a + "*" + a + "*" + a + "+"+ b + "*" + b + "*" + b +"+"+ c + "*" + c + "*" + c +"=" + i);
}
</script>
</head>
<body>
</body>
</html>
Running results :
Call up the console , Just like this :
边栏推荐
- webscoket 数据库监听
- JDBC operation MySQL example
- Goodbye, agile Scrum
- Interviewer: do you have any plan to request a lot of data that does not exist in redis to destroy the database?
- [Software Engineering] software engineering review outline of Shandong University
- 2022 cisp-pte (II) SQL injection
- log4j:WARN No such property [zipPermission] in org.apache.log4j.RollingFileAppender.
- Talk about Domain Driven Design
- Bean copy details
- From 5 seconds to 1 second, the system flies
猜你喜欢

Interviewer: do you have any plan to request a lot of data that does not exist in redis to destroy the database?

Cookie encryption 7 fidder analysis phase

js例题打印1-100之间所有7的倍数的个数及总和

Basic knowledge | JS Foundation

【软件工程】山东大学软件工程复习提纲

Solve the problem of win10 wsl2 IP change

js判断用户输入的数是否为质数(多种方法)

Stream常用操作以及原理探索

Yarn create vite reports an error 'd:\program' which is neither an internal or external command nor a runnable program or batch file

磁选机是什么?
随机推荐
(已解决) npm突然报错 Cannot find module ‘D:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js‘
What is the difference between volatile and synchronized?
mysql关于自增和不能为空
移动安全工具-jad
js来打印1-100间的质数并求总个数优化版
Get the query parameter in the address URL specify the parameter method
postgreSQL在windows系统遇到权限否认(permission denied)
1-4 进制表示与转换
Visual studio vs shortcut key usage
MySQL
Websocket database listening
How torch.gather works
apifox学习
什么是浮选机?
Configuring FTP, enterprise official website, database and other methods for ECS
进程终止(你真的学会递归了吗?考验你的递归基础)
JDBC读取Mysql数据列表
大学数据库mysql
What is a flotation machine?
Mobile security tools -jad