急!!求VB visual studio 2010写一个简单的小游戏(比如扫雷剪刀石头布)并附源代码~
# include & ltiostream & gt
# include & ltctime & gt
使用命名空间std
void main()
{
srand(time(NULL));
int p1,p2;
cout & lt& lt"当玩家出来时:" < & ltendl
开关(rand()%3)
{
案例0:
cout & lt& lt《剪刀》< & ltendl
p 1 = 0;
打破;
案例1:
cout & lt& lt“石头”
p 1 = 1;
打破;
案例二:
cout & lt& lt【布】< & ltendl
p 1 = 2;
打破;
}
cout & lt& lt"玩家二出局:"
开关(rand()%3)
{
案例0:
cout & lt& lt《剪刀》< & ltendl
p2 = 0;
打破;
案例1:
cout & lt& lt“石头”
p2 = 1;
打破;
案例二:
cout & lt& lt【布】< & ltendl
p2 = 2;
打破;
}
if(p 1 = = 0 & amp;& ampp2==0)
cout & lt& lt“领带”
else if(p 1 = = 0 & amp;& ampp2==1)
cout & lt& lt“玩家赢两次”
else if(p 1 = = 0 & amp;& ampp2==2)
cout & lt& lt"玩家赢了"
else if(p 1 = = 1 & amp;& ampp2==1)
cout & lt& lt“领带”
else if(p 1 = = 1 & amp;& ampp2==2)
cout & lt& lt“玩家赢两次”
else if(p 1 = = 1 & amp;& ampp2==0)
cout & lt& lt"玩家赢了"
else if(p 1 = = 2 & amp;& ampp2==2)
cout & lt& lt“领带”
else if(p 1 = = 2 & amp;& ampp2==0)
cout & lt& lt“玩家赢两次”
else if(p 1 = = 2 & amp;& ampp2==1)
cout & lt& lt"玩家赢了"
}