#include
#include(cctype)
using namespace std;
void print(char);
int main()
{
char i;
cout<<"please enter a letter"< cin>>i;
print(i);
return 0;
}
void print(char i)
{
if(!islower(i)||!isupper(i))
{
cout<<"Invalid letter.Enter Q or Z to quit."< }
switch(tolower(i))
{
case 'a':
case 'b':
case 'c': cout<<"Enter a letter:"< cout<<"The letter "< break;
case 'd':
case 'e':
case 'f': cout<<"Enter a letter:"< cout<<"The letter "< break;
case 'g':
case 'h':
case 'i': cout<<"Enter a letter:"< cout<<"The letter "< break;
case 'j':
case 'k':
case 'l': cout<<"Enter a letter:"< cout<<"The letter "< break;
case 'm':
case 'n':
case 'o': cout<<"Enter a letter:"< cout<<"The letter "< break;
case 'p':
case 'r':
case 's': cout<<"Enter a letter:"< cout<<"The letter "< break;
case 't':
case 'u':
case 'v': cout<<"Enter a letter:"< cout<<"The letter "< break;
case 'w':
case 'x':
case 'y': cout<<"Enter a letter:"< cout<<"The letter "< break;
default:
break;
}
}
--------------------next---------------------
阅读(1107) | 评论(0) | 转发(0) |