Home > Back-end >  Logic operation, different language result is not the same??
Logic operation, different language result is not the same??

Time:01-24

C + +
 
If (1611280101 & gt;=1611280121 & lt; 1611280121)
STD: : cout & lt; <"True" & lt; The else
STD: : cout & lt; <"False" & lt;

Output: True

Python
 
If 1611280101 & gt;=1611280121 & lt; 1611280121:
Print (True)
The else:
Print (False)

Output: False

What??

CodePudding user response:

In c + + the if (1611280101 & gt;=1611280121 & lt; 1611280121) should have & amp; & | |, such as the statement don't compile error

CodePudding user response:

This is actually (1611280101 & gt;=1611280121) & lt; 1611280121

CodePudding user response:

reference 1st floor CHXCHXKKK response:
c + + in the if (1611280101 & gt;=1611280121 & lt; 1611280121) should have & amp; & | |, such as the statement aren't compile error

Don't complain, c + + 17

CodePudding user response:

refer to the second floor early play big play nuclear response:
this is actually (1611280101 & gt;=1611280121) & lt; 1611280121

Yes, it is estimated that python is parsed into
1611280101 & gt;=1611280121 and 1611280121 & lt; 1611280121
To determine the
  • Related