#include <iostream> // std::cout, std::boolalpha, std::noboolalpha
int main () {
bool b = true;
std::cout << std::boolalpha;
std::cout << b << std::endl;
std::cout << false << std::endl;
std::cout << std::noboolalpha;
std::cout << b << std::endl;
std::cout << false << std::endl;
}
输出结果:
true
false
1
0