当前位置:网站首页>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
边栏推荐
- js如何获取集合对象中某元素列表
- PHP reflective XSS, reflective XSS test and repair
- CNN convolution neural network principle explanation + image recognition application (with source code) [easy to understand]
- LIS (longest ascending subsequence) problem that can be understood [easy to understand]
- 以飞地园区为样本,看雨花与韶山如何奏响长株潭一体化发展高歌
- 手动实现function isInstanceOf(child,Parent)
- Qtreeview+qabstractitemmodel custom model: the third of a series of tutorials [easy to understand]
- matlab遍历图像、字符串数组等基本操作
- NIO与传统IO的区别
- php反射型xss,反射型XSS测试及修复
猜你喜欢

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

BPR(贝叶斯个性化排序)

js如何获取集合对象中某元素列表

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

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

GCC编译

"The silk road is in its youth and looks at Fujian" is in the hot collection of works in the Fujian foreign youth short video competition

MySQL series transaction log redo log learning notes

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

Little p weekly Vol.11
随机推荐
【mysql 07】GPG key retrieval failed: “Couldn‘t open file /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022“
MySQL系列之事务日志Redo log学习笔记
游览器打开摄像头案例
能升职加薪?PMP证书含金量浅析
二叉树的基本操作
I received a letter from CTO inviting me to interview machine learning engineer
从MLPerf谈起:如何引领AI加速器的下一波浪潮
PHP reflective XSS, reflective XSS test and repair
MQ学习笔记
【单体】流辰信息I-BPSv3服务器推荐配置
上半年暂停考试要补考?包含监理工程师、建筑师等十项考试
A debugging to understand the slot mechanism of redis cluster
杰理之蓝牙耳机品控和生产技巧【篇】
LIS (longest ascending subsequence) problem that can be understood [easy to understand]
以飞地园区为样本,看雨花与韶山如何奏响长株潭一体化发展高歌
Business visualization - make your flowchart'run'up
Internet of things RFID, etc
[deep learning] use deep learning to monitor your girlfriend's wechat chat?
分离字符串中的字母和数字并使得字母在前数组在后
Getting started with the lockust series