为什么我在第3行得到不同的结果?输出是:
1
1
0
1
Run Code Online (Sandbox Code Playgroud)
我不应该收到行号.3还输出1而不是0?它具有与其他行相同的语法.
#include <iostream>
using namespace std;
int main()
{
int x = -3;
bool a = (x % 2 == 1) || (x < 0);
bool b = (x < 0) || (x % 2 == 1);
cout << a << "\n"; // line 1
cout << b << "\n"; // line 2
cout << (x % 2 == 1) || (x < 0); cout << "\n"; // line 3
cout …Run Code Online (Sandbox Code Playgroud)