text: how to find the english word that has a value closest to 1000000 if multiply its letters as a = 1...z = 26? use a standard substitution cipher where a = 1...z = 26.  find the english word that produces a value closest to 1 million when you multiply the letters together. if you have access to a good source of words (ie. an entire on-line dictionary would be nice), you can simply use brute force to search it.  i just used the rather meager dictionary supplied on any unix (/usr/dict/words) and discovered "nicaragua" at 1000188.  n=14 i=9 c=3 a=1 r=18 a=1 g=7 u=21 a=1  this is the same value as reported by a previous answer, although this word has the advantage that it shows up in the on-line dictionaries i tried, for example, the american heritage, at:  http://education.yahoo.com/reference/dictionary/;_ylt=aji3tkpeaxerniq3q7xkxfp0hykc  my brute force search code follows:       #include  #include  #include  #include   static int value(char* wordbuff) {   int value = 1;   for (char *p=wordbuff; *p && (*p!='&#92;n'); p++) {     if (isalpha(*p))       value *= (tolower(*p) - 'a' + 1);   }   return value; }  int main(int argc, char* argv[]) {   char wordbuff[100], bestword[100];   int bestvalue = 0;   char *filestr = argc>1 ? argv[1] : "/usr/dict/words";    file *f = fopen(filestr, "r");   if (!f)     perror("fopen"), exit(-1);    while (fgets(wordbuff, sizeof(wordbuff), f) != 0) {     int v = value(wordbuff);     if (abs(v - 1000000) < abs(bestvalue - 1000000)) {       strlcpy(bestword, wordbuff, sizeof(bestword));       bestvalue = v;     }   }   printf("%d for the word %s", bestvalue, bestword);   for (char *p=bestword; *p && (*p!='&#92;n'); p++) {     if (isalpha(*p))       printf("%c=%d ", *p, tolower(*p)-'a'+1);   }   printf("&#92;n");   return 0; }