20150913生成三个10以内的随机数,不想等

for (int i = 1; i > 0; i++)
{
Random aaa = new Random();
int yi = aaa.Next(10);
Random bbb = new Random();
int er = aaa.Next(10);
Random ccc = new Random();
int san = aaa.Next(10);
int a = yi, b = er, c = san;
if (a != b && a != c && b != c)
{
Console.WriteLine("生成的三个不想等的随机为:{0},{1},{2}", a, b, c);
break;
}
}

posted on 2015-09-22 10:08  路人甲zzz  阅读(240)  评论(0编辑  收藏  举报

导航