当前位置:网站首页>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 .
边栏推荐
- Which Bluetooth headset is good about 400? Four Bluetooth headsets with strong noise reduction are recommended
- Fcpx template: sweet memory electronic photo album photo display animation beautiful memory
- Social phobia of contemporary young people (II)
- sklearn数据预处理
- How to execute a swift for in loop in one step- How can I do a Swift for-in loop with a step?
- DAPP for getting started with eth
- ZIP文件的导出
- Arlo's thinking about himself
- 2022 P cylinder filling examination content and P cylinder filling practice examination video
- [set theory] set operation (Union | intersection | disjoint | relative complement | symmetric difference | absolute complement | generalized union | generalized intersection | set operation priority)
猜你喜欢
【刷题篇】接雨水(一维)
2022 P cylinder filling examination content and P cylinder filling practice examination video
2022deepbrainchain biweekly report no. 104 (01.16-02.15)
Which Bluetooth headset is cost-effective? Four Bluetooth headsets with high cost performance are recommended
540. Single element in ordered array
Data Lake three swordsmen -- comparative analysis of delta, Hudi and iceberg
Five elements of user experience
[graduation season · aggressive technology Er] Confessions of workers
Feature_selection
第十届中国云计算大会·中国站:展望未来十年科技走向
随机推荐
类的基础语法
JS实现图片懒加载
[no title] 2022 chlorination process examination content and free chlorination process examination questions
What is the correct way to compare ntext columns with constant values- What's the right way to compare an NTEXT column with a constant value?
【刷题篇】 找出第 K 小的数对距离
竞品分析撰写
"Final review" 16/32-bit microprocessor (8086) basic register
Two points -leetcode-540 A single element in an ordered array
Which Bluetooth headset is good about 400? Four Bluetooth headsets with strong noise reduction are recommended
2022 mobile crane driver examination registration and mobile crane driver operation examination question bank
Is pytorch open source?
SAP ui5 application development tutorial 105 - detailed introduction to the linkage effect implementation of SAP ui5 master detail layout mode
Basic syntax of class
Design and implementation of kubelet garbage collection mechanism to protect nodes from being preempted by containers image GC high threshold
Nat. Comm. | 使用Tensor-cell2cell对细胞通讯进行环境感知去卷积
leetcode:297. Serialization and deserialization of binary tree
[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
Interface in TS
[set theory] set identities (idempotent law | exchange law | combination law | distribution rate | De Morgan law | absorption rate | zero law | identity | exclusion law | contradiction law | complemen
The 10th China Cloud Computing Conference · China Station: looking forward to the trend of science and technology in the next decade