#!/usr/bin/env cscript
#include "stdio.h"
#include "string.h"
#define ALPHABET "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
int
main(int argc, char *argv[]) {
int index = 0;
char *string = "AA";
for (char *needle = string; *needle != '\0'; needle++) {
index += strchr(ALPHABET, *needle) - ALPHABET;
index *= 'Z' - 'A' + 1;
}
printf("%s → %d\n", string, index);
return 0;
}