1 2 3 4 5 6 7 8 9 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 76 77 78 79 80
|
string A, E, I, O, U, a, e, i, o, u ,line, line2;
int main()
{
cout << "Enter a line to encrypt" << endl;
cin >> line;
//vowels
int loc;
do{
loc = line.find("a");
if (loc != -1)
line = line.replace(loc, 1, "1");
} while (loc != -1);
do{
loc = line.find("A");
if (loc != -1)
line = line.replace(loc, 1, "1");
} while (loc != -1);
do{
loc = line.find("e");
if (loc != -1)
line = line.replace(loc, 1, "2");
} while (loc != -1);
do{
loc = line.find("E");
if (loc != -1)
line = line.replace(loc, 1, "2");
} while (loc != -1);
do{
loc = line.find("i");
if (loc != -1)
line = line.replace(loc, 1, "3");
} while (loc != -1);
do{
loc = line.find("I");
if (loc != -1)
line = line.replace(loc, 1, "3");
} while (loc != -1);
do{
loc = line.find("o");
if (loc != -1)
line = line.replace(loc, 1, "4");
} while (loc != -1);
do{
loc = line.find("O");
if (loc != -1)
line = line.replace(loc, 1, "4");
} while (loc != -1);
do{
loc = line.find("u");
if (loc != -1)
line = line.replace(loc, 1, "5");
} while (loc != -1);
do{
loc = line.find("U");
if (loc != -1)
line = line.replace(loc, 1, "5");
} while (loc != -1);
cout << line;
system("pause");
return 0;
}
|