- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
void Cryptogram(const vector<string> &vector1, vector<string> &vector2)
{
string word;
char new_letter;
long i, j, wordSize, vecSize, vecSize2;
vecSize = vector1.size();
for(j=0; j<vecSize; j++)
{
word = vector1[j];
//cout<<word<<endl;
wordSize = word.size();
cout<<wordSize<<endl;
for(i=0; i<wordSize; i++)
{
new_letter = word[i];
cout<<"& " << new_letter<< " " << isalpha(new_letter) << endl;
if(isalpha(new_letter)==true)
{
if(isupper(new_letter)==true)
{
if (new_letter == 'A')
new_letter = 'W';
else if(new_letter == 'B')
new_letter = 'Y';
else if(new_letter == 'C')
new_letter = 'I';
else if(new_letter == 'D')
new_letter = 'J';
else if(new_letter == 'E')
new_letter = 'K';
else if(new_letter == 'F')
new_letter = 'C';
else if(new_letter == 'G')
new_letter = 'U';
else if(new_letter == 'H')
new_letter = 'V';
else if(new_letter == 'I')
new_letter = 'D';
else if(new_letter == 'J')
new_letter = 'P';
else if(new_letter == 'K')
new_letter = 'Q';
else if(new_letter == 'L')
new_letter = 'L';
else if(new_letter == 'M')
new_letter = 'Z';
else if(new_letter == 'N')
new_letter = 'H';
else if(new_letter == 'O')
new_letter = 'T';
else if(new_letter == 'P')
new_letter = 'G';
else if(new_letter == 'Q')
new_letter = 'A';
else if(new_letter == 'R')
new_letter = 'B';
else if(new_letter == 'S')
new_letter = 'M';
else if(new_letter == 'T')
new_letter = 'X';
else if(new_letter == 'U')
new_letter = 'E';
else if(new_letter == 'V')
new_letter = 'F';
else if(new_letter == 'W')
new_letter = 'O';
else if(new_letter == 'X')
new_letter = 'N';
else if(new_letter == 'Y')
new_letter = 'R';
else if(new_letter == 'Z')
new_letter = 'S';
}
Cryptogram function, it's much longer, with 26 if statements if the letter is lowercase.
ZX_Spectrum 06.03.2011 05:48 # 0
bugmenot 06.03.2011 05:57 # +5
хотя это полиалфавитный, следовательно, бонжур, виженер
Lure Of Chaos 06.03.2011 19:45 # 0
bugmenot 06.03.2011 22:12 # 0
современность...
absolut 06.03.2011 08:57 # 0
gegMOPO4 06.03.2011 19:35 # 0
absolut 07.03.2011 00:16 # 0
ctm 08.03.2011 21:55 # −2