当前位置:网站首页>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
边栏推荐
- JS format time
- c语言在结构体传参时参数压栈问题
- Qt实战:云曦日历篇
- TLS/SSL 协议详解 (28) TLS 1.0、TLS 1.1、TLS 1.2之间的区别
- ansible及常用模块的使用
- On the insecurity of using scanf in VS
- Matlab Simulink modeling and design of single-phase AC-AC frequency converter, with MATLAB simulation, PPT and papers
- LLVM - 生成局部变量
- JumpServer
- 555 timer + 74 series chip to build eight way responder, 30s countdown, proteus simulation, etc
猜你喜欢
本以为能躺着进华为,结果陆续收到京东/滴滴/爱奇艺offer的我迷茫了
八路抢答器系统51单片机设计【附Proteus仿真、C程序、原理图及PCB文件、元器件清单和论文等】
API Gateway/API 网关(三) - Kong的使用 - 限流rate limiting(redis)
TLS/SSL 协议详解 (28) TLS 1.0、TLS 1.1、TLS 1.2之间的区别
MCU function signal generator, output four kinds of waveforms, adjustable frequency, schematic diagram, simulation and C program
Qt实战:云曦聊天室篇
Detailed explanation of SAR command
C语言知识点精细详解——数据类型和变量【2】——整型变量与常量【1】
API Gateway/API 网关(四) - Kong的使用 - 集成Jwt和熔断插件
循环队列的基本操作,你学会了吗?
随机推荐
TLC5615 based multi-channel adjustable CNC DC regulated power supply, 51 single chip microcomputer, including proteus simulation and C code
Use of ansible and common modules
Qt实战:云曦聊天室篇
如何5分钟上手使用OCR
Introduction to the use of countdownlatch and cyclicbarrier for inter thread control
51单片机+LCD12864液晶显示的俄罗斯方块游戏,Proteus仿真、AD原理图、代码、论文等
AT89C52单片机的频率计(1HZ~20MHZ)设计,LCD1602显示,含仿真、原理图、PCB与代码等
JumpServer
基于TLC5615的多路可调数控直流稳压电源,51单片机,含Proteus仿真和C代码等
在电视屏幕上进行debug调试
1分钟看懂执行流程,永久掌握for循环(附for循环案例)
基于单片机的DS18B20的数字温度监控报警系统设计【LCD1602显示+Proteus仿真+C程序+论文+按键设置等】
js 键值判断
kprobe 的 3 种使用
LLVM - 生成加法
Basic regular expression
AT89C52 MCU frequency meter (1Hz ~ 20MHz) design, LCD1602 display, including simulation, schematic diagram, PCB and code, etc
SSH 通过跳板机连接远程主机
统信UOS PHP7.2.3升级至PHP7.2.24
ie8 浏览器提示是否 阻止访问js脚本