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
|
#include<string>
#include<iostream>
using namespace std;
int main(){
string letters[24] = { Alpha", "Beta", "Gamma", "Delta", "Epsilon", "Zeta", "Eta", "Theta", "Iota", "Kappa", "Lambda", "Mu", "Nu", "Xi", "Omicron", "Pi", "Rho", "Sigma", "Tau", "Upsilon", "Phi", "Chi", "Psi", "Omega" };
string input;
bool found = false;
while ( input != "exit" )
{
cout << "Please enter string :";
cin >> input;
found = false;
for ( int i = 0; i <= 23; i++)
{
if (letters[i] == input)
{
found = true;
break;
}
}
if ( found == true )
cout<<"Yes, you entered a greek letter!"<<endl;
else
cout<<"No, you did not enter a greek letter!" << endl;
}
return 0;
}
|