Last active
December 15, 2015 22:29
-
-
Save whoo24/5333860 to your computer and use it in GitHub Desktop.
2진수 출력하기
print binary
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
void print2bin(int d) | |
{ | |
for(int i = 0; i < 32; ++i) | |
cout << ((d >> (31 - i )) & 1); | |
cout << endl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment