#include <stdio.h>
template<class T>
void print_bits(T in)
{
int i, len = sizeof(T) * 8;
for (i = 0; i < len; ++i)
printf("%d", (in >> i) & 0x1);
printf("\n");
}
int main(void)
{
char one = 1;
char allOne = ~(char)0;
print_bits(one);
print_bits(allOne);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp0ZW1wbGF0ZTxjbGFzcyBUPgp2b2lkIHByaW50X2JpdHMoVCBpbikKewoJaW50IGksIGxlbiA9IHNpemVvZihUKSAqIDg7Cglmb3IgKGkgPSAwOyBpIDwgbGVuOyArK2kpCgkJcHJpbnRmKCIlZCIsIChpbiA+PiBpKSAmIDB4MSk7CglwcmludGYoIlxuIik7Cn0KCmludCBtYWluKHZvaWQpCnsKCWNoYXIgb25lID0gMTsKCWNoYXIgYWxsT25lID0gfihjaGFyKTA7CgkKCXByaW50X2JpdHMob25lKTsKCXByaW50X2JpdHMoYWxsT25lKTsKCXJldHVybiAwOwp9