当前位置:网站首页>220214c language learning diary
220214c language learning diary
2022-07-03 04:16:00 【siecle】
One , Logical operators
&& and ||
Be careful , They are binocular operators , Cannot be used as
a && b && c
or a || b || c
Two ,switch and break
switch It can be used to replace some In the same if There are statement blocks with different results
Such as :if(a = 0)
puts(" frigging awesome ");
if (a = 1)
puts(" Horseshoe ")
if (a = 2)
puts(" People force ")
It can be replaced by :
switch(a){
case 0 : puts(" frigging awesome "); break;
case 1 : puts(" Horseshoe "); break;
case 2 : puts(" People force "); break;
default : puts(" Please enter 0 or 1 or 2, There is no other force .”)
}
It can make the statement more concise , Easy to read .
Blue (a): yes switch Expression of function , Remember to follow the curly braces to indicate the scope
purple case 0: yes “ label ”, This number is an expression (a) Results in . in addition ,case There must be a space before the next number .
gray default: When the expected value is not entered , Automatically run this statement .
Add , Don't forget it. case Add... At the end of the statement break; Otherwise, the program will be executed automatically when it runs break The next statement after .
边栏推荐
- [mathematical logic] predicate logic (judge whether the first-order predicate logic formula is true or false | explain | example | predicate logic formula type | forever true | forever false | satisfi
- 2022 mobile crane driver examination registration and mobile crane driver operation examination question bank
- [nlp] - brief introduction to the latest work of spark neural network
- DAPP for getting started with eth
- How to connect WiFi with raspberry pie
- Js/ts bottom implementation double click event
- JS native common knowledge
- Which Bluetooth headset is cost-effective? Four Bluetooth headsets with high cost performance are recommended
- The latest activation free version of Omni toolbox
- vulnhub HA: Natraj
猜你喜欢

Basic MySQL operations

540. Single element in ordered array

js实现在可视区内,文字图片动画效果

CVPR 2022 | Dalian Technology propose un cadre d'éclairage auto - étalonné pour l'amélioration de l'image de faible luminosité de la scène réelle

SAP ui5 application development tutorial 105 - detailed introduction to the linkage effect implementation of SAP ui5 master detail layout mode

How to download pytorch? Where can I download pytorch?

Mutex and rwmutex in golang

2022-07-02: what is the output of the following go language code? A: Compilation error; B:Panic; C:NaN。 package main import “fmt“ func main() { var a =
![[home push IMessage] software installation virtual host rental tothebuddy delay](/img/e7/eb20a773e4b674962f856d179a3769.jpg)
[home push IMessage] software installation virtual host rental tothebuddy delay
![[brush questions] most elements (super water king problem)](/img/79/13a715b74bc18a4a62113de76a65f6.png)
[brush questions] most elements (super water king problem)
随机推荐
JS realizes lazy loading of pictures
CVPR 2022 | 大連理工提出自校准照明框架,用於現實場景的微光圖像增强
How to download pytorch? Where can I download pytorch?
[brush questions] most elements (super water king problem)
Export of zip file
The latest activation free version of Omni toolbox
QSAR model establishment script based on pytoch and rdkit
105. Detailed introduction of linkage effect realization of SAP ui5 master detail layout mode
Which code editor is easy to use? Code editing software recommendation
"Designer universe" argument: Data Optimization in the design field is finally reflected in cost, safety and health | chinabrand.com org
[set theory] set operation (Union | intersection | disjoint | relative complement | symmetric difference | absolute complement | generalized union | generalized intersection | set operation priority)
What can learning pytorch do?
Is pytorch difficult to learn? How to learn pytorch well?
Interface in TS
MySQL timestampdiff interval
How to process the current cell with a custom formula in conditional format- How to address the current cell in conditional format custom formula?
What is pytorch? Is pytorch a software?
类的基础语法
2022 polymerization process examination questions and polymerization process examination skills
[Blue Bridge Road -- bug free code] DS18B20 temperature reading code analysis