// 逻辑与短路 #include #include using namespace std; int main() { int a = 3, b = 4; int c = (a a = 2, c = 1 int d = (a>b) && (a++); // a++不会执行 => a = 2, d = 0 cout << a << "," << b << endl; // 2, 4 cout << c << "," << d << endl; // 1, 0 }