跪求游戏源代码(C++)

来源:百度知道 编辑:UC知道 时间:2024/05/24 12:24:14
谢谢

#include <iostream>
#include <time.h>
#include <stdlib.h>
using namespace std;
int main()
{
int a,b;
srand( time(NULL));
cout<<"shuchu 1-3"<<endl;
cout<<"0--exit"<<endl;
cout<<"1--chui zi"<<endl;
cout<<"2--jian zi"<<endl;
cout<<"3--bu"<<endl<<endl;
while (1)
{

a=rand()%3+1;
cout<<"shuchu 1-3"<<endl;
cout<<"0--exit"<<endl;
cout<<"1--chui zi"<<endl;
cout<<"2--jian zi"<<endl;
cout<<"3--bu"<<endl<<endl;
cin>>b;
if(b!=1||b!=2||b!=3||b!=0)
{
cout<<"cuo wu!"<<endl;

}
if(b==0)
{
break;
}
if(a==1)
{ cout<<"dui fan