Created
November 6, 2014 01:02
-
-
Save saevarb/427a54d77096b6930e18 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 <stdio.h> | |
#include <stdlib.h> | |
int main(int argc, char* argv[]) { | |
long n = 0; | |
if(argc < 2) { | |
printf("gief args bro\n"); | |
return 1; | |
} | |
n = strtol(argv[1], NULL, 10); | |
for(int i = 0; i < (1 << n); i++) { | |
for(long k = 1 << (n - 1); k; k = k >> 1) { | |
printf("%d", (k & i) > 0); | |
} | |
printf("\n"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment