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
|
#include <iostream>
#include <string>
using namespace std;
int main()
{
string stringin;
int index = 0;
string ICAO[26] = { "Alpha" , "Bravo", "Charlie", "Delta", "Echo", "Foxtrot", "Golf",
"Hotel", "India", "Juliet", "Kilo", "Lima", "Mike", "November",
"Oscar", "Papa", "Quebec", "Romeo", "Sierra", "Tango", "Uniform"
"Victor", "Whiskey", "X-ray", "Yankee", "Zulu" } ;
do
{
cout << "Please enter string or press 9 to exit: " << endl;
cout << endl;
cin >> stringin;
cout << endl;
cout << "The phonetic version is: " << endl;
cout << endl;
for (int i=0; stringin.size(); i++)
{
string stringout;
char letter;
letter = toupper(stringin[i]);
stringout = ICAO[letter-'A'];
cout << stringout << " ";
}
cin.get();
cin.get();
} while (stringin != "9");
return 0;
}
|