//本程序由戴某人编写。
include[HTML_REMOVED]
using namespace std;
void shi_tou_2(){
const int MAX=10;
srand(time(0));
int m,n,countm,countn;
countm=countn=0;
for(;;)
{
m=rand()%3+1;
cout<<”请你出招\n”;
cout<<”1,剪刀2,石头3,布\n”;
cin>>n;
if(n<1||n>3)
cout<<”请输入1~3,此举无效!\n”;
else
{
switch(m-n)
{
case 1: cout<<"计算机赢!\n"; countm++;break;
case 0: cout<<"平局!\n"; break;
default: cout<<"你赢!\n"; countn++; break;
}
}
}
cout<<"计算机赢:"<<countm<<endl;
cout<<"你赢:"<<countn<<endl;
}
int main (){
shi_tou_2();
}