当前位置:网站首页>Find daffodils - for loop practice
Find daffodils - for loop practice
2022-04-23 14:26:00 【Zinksl】
:::info
according to Forgetting curve : If there is no record and review ,6 Days later, I will forget 75% The content of
Reading notes are a tool to help you record and review , Don't stick to form , Its core is : Record 、 Look over 、 reflection
:::
Narcissistic number (Narcissistic number) It's also called super perfect number invariant (pluperfect digital invariant, PPDI)、 Narcissistic number 、 Self idempotent 、 Armstrong number or Armstrong number (Armstrong number), The number of Narcissus refers to a 3 digit , Of the numbers in each of its bits 3 The sum of the powers is equal to itself .
Case needs
demand 1 Find out the number of all daffodils
1 adopt for Loop through three digits
2 adopt if According to the concept of narcissus number , The number of daffodils in the sun
//for Cycle to find the number of daffodils
for (int i=100;i<=999;i++){
int ge,shi,bai; // Define everyone 、 ten 、 Hundreds of variables are ready for subsequent operations
ge = i%10;
shi = i/10%10;
bai = i/100;
// use if The conditions of daffodil number were screened
if (i==(ge*ge*ge+shi*shi*shi+bai*bai*bai)){
System.out.println(" Narcissistic number :"+i);
}
}
Conclusion
If there are any questions in the text , Welcome to correct , Welcome to discuss
See here , Just order a compliment and go ღ( ´・ᴗ・` ) finger heart
版权声明
本文为[Zinksl]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231412046288.html
边栏推荐
- Processing MKDIR: unable to create directory 'AAA': read only file system
- TLC5615 based multi-channel adjustable CNC DC regulated power supply, 51 single chip microcomputer, including proteus simulation and C code
- 网页自适应,等比缩放
- 顺序表的操作,你真的学会了吗?
- AT89C51 MCU digital voltmeter development, measuring range 0 ~ 5V, proteus simulation, schematic diagram, PCB and C program, etc
- 编译Openssl
- Nacos作为配置中心(四) 使用Demo
- The initial C language framework is suitable for review and preliminary understanding
- 翻牌效果
- IE8 browser prompts whether to block access to JS script
猜你喜欢

uni-app消息推送

DS1302的电子万年历_51单片机,年月日、星期、时分秒、农历和温度,带闹钟,全套资料

常见存储类型和FTP主被动模式解析

统信UOS卸载php7.2.24,安装php7.4.27 ;卸载再安装为PHP 7.2.34

AT89C51 MCU digital voltmeter development, measuring range 0 ~ 5V, proteus simulation, schematic diagram, PCB and C program, etc

基于TLC5615的多路可调数控直流稳压电源,51单片机,含Proteus仿真和C代码等

sar命令详解

流程控制之分支语句

51 MCU + LCD12864 LCD Tetris game, proteus simulation, ad schematic diagram, code, thesis, etc

基于单片机的DS18B20的数字温度监控报警系统设计【LCD1602显示+Proteus仿真+C程序+论文+按键设置等】
随机推荐
进入新公司,运维工程师从下面这几项了解系统的部署
Tongxin UOS uninstall php7 2.24, install php7 4.27 ; Uninstall and then install PHP 7.2.34
Qt界面优化:鼠标双击特效
修改Firebase Emulators的默认侦听IP
source insight via samba
OpenFaaS实战之四:模板操作(template)
循环队列的基本操作(实验)
错误:无法远程查找到密钥 “428F7ECC7117F726“
flannel 原理 之 TUN模式
初识STL
JumpServer
redis的五种数据类型
微信小程序轮播图swiper
After entering the new company, the operation and maintenance engineer can understand the deployment of the system from the following items
Qt实战:云曦聊天室篇
LotusDB 设计与实现—1 基本概念
本以为能躺着进华为,结果陆续收到京东/滴滴/爱奇艺offer的我迷茫了
Notes on Visio drawing topology
MCU function signal generator, output four kinds of waveforms, adjustable frequency, schematic diagram, simulation and C program
JS key value judgment
