当前位置:网站首页>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
最近公共祖先离线做法(tarjan)
Manually implement function isinstanceof (child, parent)
MySQL系列之事务日志Redo log学习笔记
Do you want to make up for the suspended examination in the first half of the year? Including ten examinations for supervision engineers, architects, etc
Go — 相关依赖对应的exe
mysql 学习笔记-优化之SQL优化
杰理之、产线装配环节【篇】
随机推荐
Tops, the unit of computing power of the processor, can be carried out 1 trillion times per second
Significance and measures of security encryption of industrial control equipment
Classify boost libraries by function
杰理之蓝牙耳机品控和生产技巧【篇】
游览器打开摄像头案例
基础—io密集型计算和cpu密集型计算
PMP与NPDP之间的区别是什么?
PCB线路板塞孔工艺的那些事儿~
杰理之、产线装配环节【篇】
Business visualization - make your flowchart'run'up
PCB plug hole technology~
基于LSTM模型实现新闻分类
【商业终端仿真解决方案】上海道宁为您带来Georgia介绍、试用、教程
Can I choose to open an account for stock trading on flush? Is it safe?
【Opencv450】HOG+SVM 与Hog+cascade进行行人检测
[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!
LIS (longest ascending subsequence) problem that can be understood [easy to understand]
JS how to get a list of elements in a collection object
[NOIP2013]积木大赛 [NOIP2018]道路铺设 贪心/差分
Application of real estate management based on 3D GIS