Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- char a[3] = "01";
- int dequy(int n)
- {
- if (n > 0)
- {
- dequy(n / 2);
- cout << a[n % 2];
- }
- return n;
- }
- void nhiphan(int n)
- {
- int numOfBit = sizeof(n)* 8;
- int i;
- for (i = numOfBit - 1; i >= 0; --i)
- { printf("%d", (n >> i) & 0x01); }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement