#!/usr/bin/env cscript #include #include int main(int argc, char *argv[]) { int alphabet_needle, index = 52, column_index_needle; char ALPHABET['Z' - 'A' + 2], reverse_column_index[3 + 1], column_index[3 + 1]; for (alphabet_needle = 'A'; alphabet_needle <= 'Z'; alphabet_needle++) { ALPHABET[alphabet_needle - 'A'] = alphabet_needle; } ALPHABET['Z' - 'A' + 1] = '\0'; printf("[%s]\n", ALPHABET); for (column_index_needle = 0; index > 0; column_index_needle++) { reverse_column_index[column_index_needle] = ALPHABET[(index - 1) % ('Z' - 'A' + 1)]; index = (index - 1) / ('Z' - 'A' + 1); } for (column_index_needle = 0; column_index_needle < strlen(reverse_column_index); column_index_needle++) { column_index[column_index_needle] = reverse_column_index[strlen(reverse_column_index) - column_index_needle - 1]; } printf("%s\n", column_index); }