#include<iostream>
using namespace std;
int main()
{
int x = 1, y = 1, z = 1, w = 0;
cout << (w=++x||++y&&++z) << "\n";
return 0;
}
若按运算符计算w=2,实则打印结果为1,代表true。
#include<iostream>
using namespace std;
int main()
{
int x = 1, y = 1, z = 1, w = 0;
cout << (w=++x||++y&&++z) << "\n";
return 0;
}
若按运算符计算w=2,实则打印结果为1,代表true。