cout 《 "打平了!" 《 "****************……你的胜率:" 《 rate 《 "%" 《 endl;
}
if ((com == 1) && (you == 2))
{
cout 《 "你赢了!****" 《 "电脑>>>石头****你>>>布" 《 "……你的胜率:" 《 rate 《 "%" 《 endl;
Count_you++;
}
if ((com == 1) && (you == 3))
{
cout 《 "你输了!****" 《 "电脑>>>石头****你>>>剪刀" 《 "……你的胜率:" 《 rate 《 "%" 《 endl;
Count_com++;
}
if ((com == 2) && (you == 1))
{
cout 《 "你输了!****" 《 "电脑>>>布 ****你>>>石头" 《 "……你的胜率:" 《 rate 《 "%" 《 endl;
Count_com++;
}
if ((com == 2) && (you == 3))
{
cout 《 "你赢了!****" 《 "电脑>>>布 ****你>>>剪刀" 《 "……你的胜率:" 《 rate 《 "%" 《 endl;
Count_you++;
}
if ((com == 3) && (you == 1))
{
cout 《 "你赢了!****" 《 "电脑>>>剪刀****你>>>石头" 《 "……你的胜率:" 《 rate 《 "%" 《 endl;
Count_you++;
}
if ((com == 3) && (you == 2))
{
cout 《 "你输了!****" 《 "电脑>>>剪刀****你>>>布 " 《 "……你的胜率:" 《 rate 《 "%" 《 endl;
Count_com++;
}
}
/////////////主函数//////////////////////
int main()
{
int choice=0;
again: cout 《 "________________________概率测试_____________________" 《 endl;
cout 《 "1.石头剪刀布。" 《 endl;
cout 《 "2.抛硬币。" 《 endl;
cout 《 "3.π的计算。" 《 endl;
cout 《 "_____________________________________________________" 《 endl;
cin 》 choice;
switch (choice)
{
case 1:start1();
case 2:start2();
case 3:start3();
[cpp] view plaincopy在CODE上查看代码片派生到我的代码片
default:goto again;
}
system("pause");