发布网友 发布时间:2022-04-23 03:33
共2个回答
热心网友 时间:2023-10-13 11:18
import java.util.Arrays;
import java.util.Random;
public class Main
{
public static void main(String[] args)
{
int array[] = new int[10];
for(int i=0;i<10;i++)
{
array[i] = new Random().nextInt(90) + 10;
}
Arrays.sort(array);
System.out.println("生成的随机数的排序结果是:"+Arrays.toString(array));
}
}
热心网友 时间:2023-10-13 11:18
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim rnd As Random = New Random
Dim l As List(Of Integer) = New List(Of Integer)
Dim tmp As Integer = 0
For i As Integer = 0 To 9 Step 1
tmp = rnd.Next(10, 100)
l.Add(tmp)
Next
l.Sort()
For i As Integer = l.Count - 1 To 0 Step -1
TextBox1.Text += l(i).ToString + vbCrLf
Next
End Sub