int[] 随机数组 = {/*给定均值,和取值范围,生成一组随机数怎么实现啊?https://bbs.csdn.net/topics/392559653#post-403779023*/};
do
{
随机数组 = Enumerable.Range(1, 5).Select(数 => new Random(Guid.NewGuid().GetHashCode()).Next(55, 65)).Distinct().ToArray();
//if (随机数组.Count() < 5) continue;
} while (随机数组.Sum() != 300);
MessageBox.Show(string.Join("|", 随机数组.Select(aa => (double)aa / 10).ToArray()));
int[] 随机数组 = {/*答复https://bbs.csdn.net/topics/392559653*/ };
do
{
随机数组 = Enumerable.Range(1, 5)
.Select(数 => new Random(Guid.NewGuid().GetHashCode()).Next(550, 650))
.Distinct(/*用去重函数得不重复数组*/).ToArray();
} while (随机数组.Sum() != 6 * 5 * 100);
MessageBox.Show(string.Join("+", 随机数组.Select(aa => Math.Round((double)aa / 100, 1)))
+ "=" + 随机数组.Select(aa => Math.Round((double)aa / 100, 1)).Sum(/*用保留小数位可扩大选数范围到百倍*/));