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