因为它在早些时候工作得很好,但是当我去添加一些其他功能时,我的程序吓坏了,我无法将它恢复到原来的状态.
我让我写一个摇滚/纸/剪刀程序来对抗计算机,任何有关循环不断终止的帮助都会很精彩
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
void RPSout(char);
int RPScomp();
int main() {
char choice;
int endit=0;
while (endit == 0)
{
cout << "\n\n\tReady to play Rock/Paper/Scissors against the computer??(please choose R/P/S)(Q to quit)\n";
cin >> choice;
RPSout(choice);
if (choice=='Q'||'q')
{endit=1;}
}
return 0;
}
void RPSout(char choose)
{
int RPS =0;
int comp=0;
switch (choose)
{
case 'R':
case 'r':
{
cout <<"Your choice: Rock";
break;
}
case 'P':
case 'p':
{
cout …Run Code Online (Sandbox Code Playgroud)