do
{
while (cin >> ch)
{
switch(ch)
{
case 'c':cout << str_prefix + str_c + '.'; break;
case 'p':cout << str_prefix + str_p + '.'; break;
case 't':cout << str_prefix + str_t + '.'; break;
case 'g':cout << str_prefix + str_g + '.'; break;
}
break;
cout << str_reInputInfo;
}
break;
cin.clear();
}while(1);
这样你试试,
{
while (cin >> ch)
{
switch(ch)
{
case 'c':cout << str_prefix + str_c + '.'; break;
case 'p':cout << str_prefix + str_p + '.'; break;
case 't':cout << str_prefix + str_t + '.'; break;
case 'g':cout << str_prefix + str_g + '.'; break;
}
break;
cout << str_reInputInfo;
}
break;
cin.clear();
}while(1);
这样你试试,