简体   繁体   English

伪代码中的“!”是什么意思? 我知道“!”代表阶乘,但我无法翻译它

[英]What does “!” mean in pseudo-code? I know “!” stands for factorial but I can't translate it

What does ! 这是什么! mean in pseudo-code? 在伪代码中意味着什么? I know ! 我知道! stands for factorial but I can't translate it . 代表阶乘,但我无法翻译它。

ex: 例如:

get operation 得到操作

if (operation!= ’B’ OR operation != ’D’ OR operation!= ’W’) then
    print "Invalid Operation"

What does it mean? 这是什么意思?

!= means not equal and ! !=意味着不平等! generally means not or negation . 一般意味着不是否定

It means "not". 这意味着“不”。 So your example code 所以你的示例代码

if (operation!= ’B’ OR operation != ’D’ OR operation!= ’W’)

can be read as 可以读作

"If operation does not equal 'B' or operation does not equal 'D' or operation does not equal 'W'" “如果操作不等于'B'或操作不等于'D'或操作不等于'W'”

In general , 一般来说

! means not 意思不是
|| means logical or 意味着logical
&& means logical and &&意味着logical

Example: 例:

!false == true  ( == means equality )

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM