双输入,所以我想:麻烦与validaton C++程序
- 做一做里面的双输入验证while循环
- 检查是否此举尚未作出,是否有一个逻辑输入。 (#1-9)
我原本以为如果其他语句,但我不知道如何使用else语句返回到循环的开始。
do
{
cout << "Interesting move, What is your next choice?: ";
cin >> play;
Pused[1] = play;
if(play != Pused[0] && play != cantuse[0] && play != cantuse[1])
{
switch(play)
{
default:cout << "Your choice is incorrect\n\n";
break;
}
}
else
{ }
}
while(play != 1 && play != 2 && play != 3 && play != 4 && play != 5 && play != 6 && play != 7 && play != 8 && play != 9);
Dis_board(board);
请你的代码减少到最低限度,如果你希望人们读它 –