当前位置:网站首页>Make a three digit number of all daffodils "recommended collection"
Make a three digit number of all daffodils "recommended collection"
2022-07-01 22:11:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm your friend, Quan Jun .
/**
* subject : Print out all " Narcissistic number ", So-called " Narcissistic number " A three digit number ,
* The sum of its cubes is equal to the number itself . for example :153 It's a " daffodils
* Count ", because 153=1 The third power of +5 The third power of +3 The third power of
*/
public class Narcissistic number {
public static void main(String[] args) {
for (int i = 100; i < 1000; i++) {
int first = i/100;
int secode= i/10%10;
int thrid = i%10;
if (first*first*first+secode*secode*secode+thrid*thrid*thrid == i) {
System.out.println(i+" It's Narcissus ");
}
}
}
}Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/147187.html Link to the original text :https://javaforall.cn
边栏推荐
猜你喜欢

Go - exe corresponding to related dependency

Little p weekly Vol.11

ICML2022 | 基于元语义正则化的介入性对比学习

人才近悦远来,望城区夯实“强省会”智力底座

PMP证书真的有用吗?

Introduction à l'ingénierie logicielle (sixième édition) notes d'examen de Zhang haifan

PMP与NPDP之间的区别是什么?

4. 对象映射 - Mapping.Mapstercover

Kuberntes云原生实战一 高可用部署架构

Halcon知识:三维重构的一个尝试
随机推荐
Qtreeview+qabstractitemmodel custom model: the third of a series of tutorials [easy to understand]
分离字符串中的字母和数字并使得字母在前数组在后
Flume面试题
测试撤销1
同花顺股票开户选哪个券商好手机开户是安全么?
选择在同花顺上炒股开户可以吗?安全吗?
UVM教程
浏览器tab页之间的通信
mysql 学习笔记-优化之SQL优化
从20s优化到500ms,我用了这三招
微软、哥伦比亚大学|GODEL:目标导向对话的大规模预训练
Go - exe corresponding to related dependency
都能看懂的LIS(最长上升子序列)问题[通俗易懂]
PWN攻防世界cgpwn2
【级联分类器训练参数】Training Haar Cascades
[STM32] stm32cubemx tutorial II - basic use (new projects light up LED lights)
【STM32】STM32CubeMX教程二–基本使用(新建工程点亮LED灯)
Unity 使用Sqlite
[live broadcast review] the first 8 live broadcasts of battle code Pioneer have come to a perfect end. Please look forward to the next one!
JS how to get a list of elements in a collection object