File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 15
15
16
16
正确答案:11.
17
17
18
- ** 考察知识点:逻辑运算符与( &和&&)或( |和||) **
18
+ ** 考察知识点:&和&&; |和||**
19
19
20
20
** &和&&:**
21
21
22
- 共同点:它们都表示运算符的两边都是true时,结果为true;
22
+ 共同点:两者都可做逻辑运算符。 它们都表示运算符的两边都是true时,结果为true;
23
23
24
- 不同点: & 表示在运算时两边都会计算,然后再判断;&&表示先运算符号左边的东西,然后判断是否为true,是true就继续运算右边的然后判断并输出,是false就停下来直接输出不会再运行后面的东西。
24
+ 不同点: &也是位运算符。& 表示在运算时两边都会计算,然后再判断;&&表示先运算符号左边的东西,然后判断是否为true,是true就继续运算右边的然后判断并输出,是false就停下来直接输出不会再运行后面的东西。
25
25
26
26
** |和||:**
27
27
28
- 共同点:它们都表示运算符的两边任意一边为true,结果为true,两边都不是true,结果就为false;
28
+ 共同点:两者都可做逻辑运算符。 它们都表示运算符的两边任意一边为true,结果为true,两边都不是true,结果就为false;
29
29
30
- 不同点:| 表示两边都会运算,然后再判断结果;|| 表示先运算符号左边的东西,然后判断是否为true,是true就停下来直接输出不会再运行后面的东西,是false就继续运算右边的然后判断并输出。
30
+ 不同点:|也是位运算符。| 表示两边都会运算,然后再判断结果;|| 表示先运算符号左边的东西,然后判断是否为true,是true就停下来直接输出不会再运行后面的东西,是false就继续运算右边的然后判断并输出。
31
31
32
32
** 回到本题:**
33
33
You can’t perform that action at this time.
0 commit comments