1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
// bitset::all
#include <iostream> // std::cin, std::cout, std::boolalpha
#include <bitset> // std::bitset
int main ()
{
std::bitset<8> foo;
std::cout << "Please, enter an 8-bit binary number: ";
std::cin >> foo;
std::cout << std::boolalpha;
std::cout << "all: " << foo.all() << '\n';
std::cout << "any: " << foo.any() << '\n';
std::cout << "none: " << foo.none() << '\n';
return 0;
}
|