方式一 使用该方法要包含头文件 #include < bitset > 代码: #include <iostream> #include <bitset> using namespace std; int main(int argc, char** argv)