石头剪刀布游戏 帮忙查找错误
int b = 0;for (int i = 0; b != 5; i++)
{
// 计算机出拳
int a, c = 0, d = 0, e = 0;
Random r = new Random();
a = r.Next(1, 3);
Console.WriteLine("请出拳:其中1代表拳头;2代表剪刀;3代表布");
b = Convert.ToInt32(Console.Read());
Console.WriteLine("你出拳为{1} + 计算机为{2}", b, a);
if (a == b)
{
Console.WriteLine(" 平局 ");
c = c + 1;
}
else if ((a == 1 && b == 2) || (a == 2 && b == 3) || (a == 3 && b == 1))
{
Console.WriteLine("你输了");
d = d + 1;
}
else
{
Console.WriteLine("你赢了");
e = e + 1;
}
Console.WriteLine("不玩时请输入5");
b = Convert.ToInt32(Console.ReadLine());
if (b == 5)
{
int f = c + d + e;
Console.WriteLine("共玩{0} 为胜局为{1} 平局为{2} 负局为{3}", f, e, c, d);
}
}