标签:
static void Main(string[] args)
{
while (true)
{
int x, y, m;
Random r = new Random();
x = r.Next(0, 3);
y = r.Next(0, 3);
m = x - y;
Console.Write("x="+x+"\ty="+y);
if( m == -2||m == 1 )
{
Console.Write("那就是x赢");
}
else if (m ==2|| m ==-1)
{
Console.Write("那就是y赢");
}
else
{
Console.Write("那就是xy平手");
}
Console.ReadLine();
}
}
标签:
原文地址:http://www.cnblogs.com/dlexia/p/4373608.html