Created
June 1, 2014 21:28
-
-
Save rhardih/cd9a39e875c8bd50c9db to your computer and use it in GitHub Desktop.
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 <stdio.h> | |
#include <string.h> | |
int main(int argc, char const *argv[]) | |
{ | |
int i, j, mod; | |
char tmp[50] = ""; | |
char result[50] = ""; | |
for(i = 1; i < 817; i++) { | |
j = i; | |
result[0] = '\0'; | |
while(j > 0) { | |
mod = (j - 1) % 26; | |
sprintf(tmp, "%c", mod + 65); | |
j = (j - mod) / 26; | |
strcat(tmp, result); | |
sprintf(result, "%s", tmp); | |
} | |
printf("%s\n", result); | |
} | |
return 0; | |
} |
Author
rhardih
commented
Jun 1, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment