int a = 5; for (int i = 0; i < 10; i++) { if (a & (1 << i)) cout << 1; else cout << 0; } //출력 1010000000