当前位置:网站首页>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
边栏推荐
- 工控设备安全加密的意义和措施
- [monomer] recommended configuration of streaming information i-bpsv3 server
- 测试撤销1
- 【单体】流辰信息I-BPSv3服务器推荐配置
- List announced | outstanding intellectual property service team in China in 2021
- 开环和闭环是什么意思?
- CNN convolution neural network principle explanation + image recognition application (with source code) [easy to understand]
- 使用闭包实现点击按钮切换 toggle
- PMP证书真的有用吗?
- 从20s优化到500ms,我用了这三招
猜你喜欢

PMP证书真的有用吗?

AIDL基本使用

Go - exe corresponding to related dependency

List announced | outstanding intellectual property service team in China in 2021

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

从MLPerf谈起:如何引领AI加速器的下一波浪潮

ngnix基础知识

函数基本学习之一

leetcode刷题:栈与队列01(用栈实现队列)

Microsoft, Columbia University | Godel: large scale pre training of goal oriented dialogue
随机推荐
What is the difference between consonants and Initials? (difference between initials and consonants)
ICML2022 | 基于元语义正则化的介入性对比学习
基于K-means的用户画像聚类模型
功利点没啥!
[monomer] recommended configuration of streaming information i-bpsv3 server
[noip2013] building block competition [noip2018] road laying greed / difference
统计字符中每个字符出现的个数
Training on the device with MIT | 256Kb memory
小 P 周刊 Vol.11
Aidl basic use
Kuberntes云原生实战一 高可用部署架构
从20s优化到500ms,我用了这三招
Using closures to switch toggle by clicking a button
最近公共祖先离线做法(tarjan)
能升职加薪?PMP证书含金量浅析
PMP证书真的有用吗?
Classify boost libraries by function
NIO与传统IO的区别
Electron学习(三)之简单交互操作
Pytest collection (2) - pytest operation mode