当前位置:网站首页>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
边栏推荐
猜你喜欢

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

手动实现function isInstanceOf(child,Parent)

Basic operation of binary tree

MySQL series transaction log redo log learning notes

东哥套现,大佬隐退?

Halcon知识:三维重构的一个尝试

杰理之、产线装配环节【篇】

Talking from mlperf: how to lead the next wave of AI accelerator

功利点没啥!

Pytest collection (2) - pytest operation mode
随机推荐
Wechat applet, continuously playing multiple videos. Synthesize the appearance of a video and customize the video progress bar
芭比Q了!新上架的游戏APP,咋分析?
MIT|256KB 内存下的设备上训练
leetcode刷题:栈与队列02(用队列实现栈)
以飞地园区为样本,看雨花与韶山如何奏响长株潭一体化发展高歌
pytest合集(2)— pytest運行方式
一次调试去了解redis集群的slot机制
locust 系列入门
NIO与传统IO的区别
MQ学习笔记
游览器打开摄像头案例
功利点没啥!
ICML2022 | 基于元语义正则化的介入性对比学习
leetcode刷题:栈与队列01(用栈实现队列)
运放-滞回(迟滞)比较器全流程实战计算
Little p weekly Vol.11
能升职加薪?PMP证书含金量浅析
最近公共祖先离线做法(tarjan)
都能看懂的LIS(最长上升子序列)问题[通俗易懂]
Tops, the unit of computing power of the processor, can be carried out 1 trillion times per second