Java打印水仙花数
2024-08-26 10:59:53
public class Test2 {
public static void main(String[] args) {
//水仙花 数 指的是一个三位数(100-999)
//三位数本身= 百位数立方+十位数的立方+个位数的立方
//153 = 1*1*1+5*5*5+3*3*3
for(int i=100;i<1000;i++){
int bai=i/100%10; //
int shi = i/10%10;
int ge = i%10;
if(i==bai*bai*bai+shi*shi*shi+ge*ge*ge){
System.out.println(i);
}
}
}
}
最新文章
- 鼠标上下滑动总是放大缩小页面,按住ctrl+0
- Python正则式的基本用法
- ACM 红黑树
- Windows 下Apace tomcat
- IIS FTP文件服务器搭建步骤
- [Java] 遍历HashMap和HashMap转换成List的两种方式
- window7 输入什么命令可以快速打开服务管理?? 虚拟机设置了NAT网络连接方式,还是无法上网?
- IDEA jsp模板
- VS中无法打开Qt资源文件qrc
- 活代码LINQ——08
- 使用Python进行并发编程
- sas通过IMPORT过程读取外部文件数据
- 设计模式,Let&#39;s “Go”! (上)
- codeforces624A
- openstack-networking-neutron(一)---端到端和点到点的理解
- MDP中值函数的求解
- 216. 组合总和 III
- WINDOWS 的 MKLINK : 硬链接,符号链接 : 文件符号链接, 目录符号链接 : 目录联接
- php判断来访者是否是搜索引擎的蜘蛛
- [翻译]Writing Custom Common Controls 编写自定义控件
热门文章
- python使用变量
- RabbitMQ 设置消息的TTL(过期时间)
- asp.net MVC之AuthorizeAttribute浅析
- EF-使用迁移技术让程序自动更新数据库表结构
- Flatten Nested List Iterator
- tf.nn.conv2d
- DevExpress v18.1新版亮点——Reporting篇(二)
- E - Mahmoud and Ehab and the bipartiteness CodeForces - 862B (dfs黑白染色)
- 安装Android开发工具
- shiro学习笔记 (一)shiro的简介