class Program
{
static void Main(string[] args)
{
int random1, random2, flag = 0;
int[] a;
int i, tmp, randtmp;
a = new int[52];
for (i = 0; i < 52; i++)
{
a[i] = i;
}
{
static void Main(string[] args)
{
int random1, random2, flag = 0;
int[] a;
int i, tmp, randtmp;
a = new int[52];
for (i = 0; i < 52; i++)
{
a[i] = i;
}
//随机数产生函数
Random r1 = new Random();
for (i = 0; i < 52; i++)
{
randtmp = (int)(r1.NextDouble() * 52);
tmp = a[i];
a[i] = a[randtmp];
a[randtmp] = tmp;
}
Random r1 = new Random();
for (i = 0; i < 52; i++)
{
randtmp = (int)(r1.NextDouble() * 52);
tmp = a[i];
a[i] = a[randtmp];
a[randtmp] = tmp;
}
for (i = 0; i < 52; i++)
{
Console.Write(" {0}", a[i]);
}
}
}
{
Console.Write(" {0}", a[i]);
}
}
}
转载于:https://blog.51cto.com/lp4083331/195379