添加cout.setf(ios_base::boolalpha);语句。
using namespace std;
int main() {
int x = 100;
cout << "x = " << x << endl;
cout << (x > 3) << endl;
cout << (x < 3) << endl;
cout.setf(ios_base::boolalpha);//bool类型显示
cout << (x > 3) << endl;
cout << (x < 3) << endl;
system("pause");
return 0;
}