当前位置:网站首页>Master in minutes --- ternary operator (ternary operator)
Master in minutes --- ternary operator (ternary operator)
2022-04-23 14:26:00 【Zinksl】
:::
according to Forgetting curve : Words , The best time to plant a tree is ten years ago and now
:::
The format of the ternary operator :
Judge the condition ? value 1 : value 2;
Execute the process :
1 Judge whether the condition is true ?
2 If the judgment condition is true , be value 1 The result assigned to this statement ;
3 If the judgment condition is false , be value 2 The result assigned to this statement ;
public void operator(){
int a,b,c;
a = 10;
b = 20;
// The first case is the judgment condition (b>a) It's true
c = b>a ? a:b;//c The value of is 10;
// Second case judgment condition (b<a) For false
c = b<a ? a:b;//c The value of is 20;
}
版权声明
本文为[Zinksl]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231412046411.html
边栏推荐
- 交通灯系统51单片机设计(附Proteus仿真、C程序、原理图及PCB、论文等全套资料)
- 爬虫练习题(一)
- 矩阵交换行列
- JS recursion (1)
- 剑指offer刷题(1)--面向华为
- Matlab Simulink modeling and design of single-phase AC-AC frequency converter, with MATLAB simulation, PPT and papers
- Qt实战:云曦聊天室篇
- 统信UOS卸载php7.2.24,安装php7.4.27 ;卸载再安装为PHP 7.2.34
- Quickly understand the three ways of thread implementation
- Five ways of using synchronized to remove clouds and fog are introduced
猜你喜欢
四层和八层电梯控制系统Proteus仿真设计,51单片机,附仿真和Keil C代码
555 timer + 74 series chip to build eight way responder, 30s countdown, proteus simulation, etc
LM317的直流可调稳压电源Multisim仿真设计(附仿真+论文+参考资料)
PWM speed regulation control system of DC motor based on 51 single chip microcomputer (with complete set of data such as Proteus simulation + C program)
sar命令详解
Matlab Simulink modeling and design of single-phase AC-AC frequency converter, with MATLAB simulation, PPT and papers
Notes on Visio drawing topology
Use the executors class to quickly create a thread pool
xx项目架构随记
KVM learning resources
随机推荐
时间复杂度计算举例
Docker篇 (五) MySQL的安装
Mq-2 and DS18B20 fire temperature smoke alarm system design, 51 single chip microcomputer, with simulation, C code, schematic diagram, PCB, etc
关于UDP接收icmp端口不可达(port unreachable)
初始c语言大致框架适合复习和初步认识
Tongxin UOS uninstall php7 2.24, install php7 4.27 ; Uninstall and then install PHP 7.2.34
初识STL
Usage of BC
数组模拟队列进阶版本——环形队列(真正意义上的排队)
Introduction to the use of countdownlatch and cyclicbarrier for inter thread control
SED 学以致用
js 格式化时间
AT89C52单片机的频率计(1HZ~20MHZ)设计,LCD1602显示,含仿真、原理图、PCB与代码等
Get the thread return value. Introduction to the use of future interface and futuretask class
Qt界面优化:Qt去边框与窗体圆角化
四层和八层电梯控制系统Proteus仿真设计,51单片机,附仿真和Keil C代码
LLVM - 生成加法
Quickly understand the three ways of thread implementation
Mysql的安装过程(已经安装成功的步骤说明)
操作系统常见面试题目: