#include<bitset> int a = 888; cout << bitset<sizeof(int)*8>(a) << endl; //.to_sttring(), bitset类型转string类型
a 必须是10进制有符号数