求教各位,如果用任意的五个数字(比如:1,2,3,4,5)生成可能生成的所有三位数,要实现这样的算法,该怎么写呀?!
------解决方案--------------------------------------------------------
int[] ary = new int[]{1,2,3,4,5}; Random rm = new Random(DateTime.Now.Millisecond); string str = ary[rm.Next()%ary.Length].ToString() + ary[rm.Next() % ary.Length].ToString() + ary[rm.Next() % ary.Length].ToString(); Response.Write(str);