```cpp #include <iostream> #include <string> #include <vector> #include <fstream>
using namespace std;
char quirkdecode(int i, vector<string> dict);
int main(int argc, char argv) {
// Load the dictionary
vector<string> dict;
ifstream dictstream("doi.txt");
string str;
while (dictstream >> str)
dict.push_back(str);
int i, j=0;
while (cin >> i) {
j ++;
cout << quirkdecode(i,dict);
if (j%5 == 0) cout << " ";
if (j%75 == 0) cout << endl;
//*/
}
cout << endl;
return 0;
}char quirkdecode(int i, vector<string> dict){ int delta=0;
if (i==155) return 'a';// Beale Paper DOI has extra 'a' in "institute a new government"
if (i>155) delta-=1; // Compensate for missing 'a' in doi.txt
if (i>=242) delta+=1; // 241 decrypts correct 246 not so delta +1 @ [241-245]
if (i>=480) delta+=10; // 466 decrypts correct 485 not so delta +10 @ [267-285] known misnumbering
if (i>=510) delta-=1; // TODO presicely ocate
if (i>=621) delta+=1; // 620 decrypts correct 643 is not so delta +1 @ [621-643]
if (i>=667) delta+=1; // 666 decrypts correct 807 is not so delta +1 @ [667-807] ? double check ??
// Hardcoded Jokers: NOTE 811 and 1005 are also the highest used codes, so it DOES seem to be intended as real
if (i==811) return 'y' ; // fundamentallY
if (i==1005) return 'x' ; // seXes
i+=delta;
if (i<dict.size())
return dict.at(i-1)[0];
else
return '!';
}
```which gives:
``` ihave depos itedi nthec ounty ofBed forda boutf ourmi lesfr ombuf ordsi nanex cavat ionor vault sixfe etbel owthe surfa ceoft hegro undth efoll owing artic lesbe longi ngjoi ntlyt othep artie swhos ename sareg iveni nnumb erthr eeher ewith thefi rstde posit consi stcdo ftenh undre dandf ourte enpou ndsof golda ndthi rtyei ghthu ndred andtw elvep ounds ofsil verde posit ednov eight eenni netee nthes econd Wasma dedec eight eentw entyo neand consi stedo fnine teenh undre dands evenp ounds ofgol dandt welve hundr edand eight yeigh tofsi lvera lsoje welso btain edins tloui sinex chang etosa vetra nspor tatio nandv alued atthi rteen rhous anddo llars theab oveis secur elypa ckedi niron potsw ithir oncov ersth evaul tisro ughly lined withs tonea ndthe vesse lsres tonso lidst onean darec overe dwith other spape rnumb erone descr ibest hcexa ctloc ality ofthe varlt sotha tnodi fficu ltywi llbeh adinf indin git ```