作者在 2008-09-29 11:52:02 发布以下内容
void shuffle ( int a[])
{
int tmp = 0;
int p1 = 0 ;
int p2 = 0;
int switchTime = new Random().nextInt(1000);
while (switchTime--<1)
{
p1 = new Random().nextInt(52) ;
p2 = new Random().nextInt(52) ;
tmp = a[p1];
a[p1] = a[p2];
a[p2] = tmp;
}
}
{
int tmp = 0;
int p1 = 0 ;
int p2 = 0;
int switchTime = new Random().nextInt(1000);
while (switchTime--<1)
{
p1 = new Random().nextInt(52) ;
p2 = new Random().nextInt(52) ;
tmp = a[p1];
a[p1] = a[p2];
a[p2] = tmp;
}
}