
image.png

image.png
Random random = new Random();
int[] a = new int[5];
int max = 0;
for (int i = 0; i < a.Length; i++)
{
a[i] = random.Next(1, 100);
Console.WriteLine(a[i]);
if (max < a[i])
{
max = a[i];
}
}
Console.WriteLine("最大值是" + max);