📜  c++ 将数字显示为二进制 - C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:47.786000             🧑  作者: Mango

代码示例2
#include 
#include 

int main() {
    int a = -58, b = a>>3, c = -315;

    std::cout << "a = " << std::bitset<8>(a)  << std::endl;
    std::cout << "b = " << std::bitset<8>(b)  << std::endl;
    std::cout << "c = " << std::bitset<16>(c) << std::endl;
}