当前位置:网站首页>Get the number of daffodils
Get the number of daffodils
2022-07-29 05:47:00 【Just learning records】
Get the number of daffodils
<script type="text/javascript">
/**
* The number of Narcissus refers to a 3 digit , The number on each of his bits 3 The sum of powers equals itself
* ( for example :1^3 + 5^3 + 3^3 = 153) Please print the number of all daffodils
*/
// Print all three digits
for(var i = 100; i < 1000; i++){
// obtain i Hundred bit ten bits The number of
// Get hundreds of digits
var bai = parseInt(i / 100);
// Get a ten digit number
var shi = parseInt((i-bai*100)/10);
// Get the number in bits
var ge = parseInt(i%10);
// Judge i Is it Narcissus
if(bai*bai*bai + shi*shi*shi + ge*ge*ge == i){
console.log(i);
}
}
</script>
边栏推荐
- 365 day challenge leetcode1000 question - day 036 binary tree pruning + subarray and sorted interval sum + delete the shortest subarray to order the remaining arrays
- JDBC连接数据库详细步骤
- 与开源项目同步开发& CodeReview & Pull Request & fork怎么拉取原始仓库
- Laravel Swagger添加访问密码
- How to survive in the bear market of encryption market?
- [C language series] - string + partial escape character explanation + annotation tips
- Fvuln-自动化web漏洞检测工具
- The Platonic metauniverse advocated by musk has long been verified by platofarm
- [typescript] learn typescript object types in depth
- sql-server 数据表的简单操作
猜你喜欢

Introduction to C language array to proficiency (array elaboration)

DAY13:文件上传漏洞

Masscan使用教程.
![[C language series] - constants and variables that confuse students](/img/24/1158034a5de413ea4ce160c5bfcbb4.png)
[C language series] - constants and variables that confuse students

The LAAS protocol of defi 2.0 is the key to revitalizing the development of defi track

Win10 compiles ffmpeg (including ffplay)

大部分PHP程序员,都搞不懂如何安全代码部署

“山东大学移动互联网开发技术教学网站建设”项目实训日志七

DAY6:利用 PHP 编写登陆页面

Day14: upload labs customs clearance tutorial
随机推荐
Starfish OS: create a new paradigm of the meta universe with reality as the link
山寨币SHIB 在 ETH 鲸鱼的投资组合中拥有 5.486 亿美元的股份——交易者应提防……
[electronic circuit] how to select ADC chip
使用Qss设置窗体样式
The difference between link and @import importing external styles
超简单集成HMS ML Kit 实现parental control
“山东大学移动互联网开发技术教学网站建设”项目实训日志六
The openatom openharmony sub forum was successfully held, and ecological and industrial development entered a new journey
Introduction to C language array to proficiency (array elaboration)
Crypto giants all in metauniverse, and platofarm may break through
Read and understand move2earn project - move
Installation steps and environment configuration of vs Code
Move protocol global health declaration, carry out the health campaign to the end
我的理想工作,码农的绝对自由支配才是最重要的——未来创业的追求
Qtcreator+cmake compiler settings
Win10 搭建MSYS2环境
熊市慢慢,Bit.Store提供稳定Staking产品助你穿越牛熊
Fantom (FTM) 价格将在未来几天飙升 20%
Fvuln-自动化web漏洞检测工具
深度学习的趣味app简单优化(适合新手)