如何产生1到4的随机数?
如何产生1到4的随机数?
------解决方案--------------------Random GenRan1 = new Random ();
Random GenRan2 = new Random (GenRan1.Next ());
MyValue = GenRan2.NextDouble() *3+1;
------解决方案--------------------int r = new Random().Next(1, 4);
------解决方案--------------------int i = new Random().Next(1, 5);