1.程序参考Private Sub Form_Click()Dim a(1 To 20) As Integer, i, j, t, x, yesFor i = 1 To 20Dox = Int(Rnd * 90) + 10yes = 0For j = 1 To 20If x = a(j) Then yes = 1: Exit ForNext jLoop While yes = 1a(i) = xNext iFor i = 1 To 19For j = i + 1 To 20If a(i) > a(j) Then t = a(i): a(i) = a(j): a(j) = tNext jNext iFor i = 1 To 20Print a(i);Next iEnd Sub2。Public Sub Calculate()Dim x(1 To 10) As Integer, A(1 To 100) As IntegerDim P As Integer, J As IntegerFor J = 1 To 100A(J) = Rnd * 100P = A(J) - Int(A(J) / 10) * 10If P = 0 Then P = 10x(P) = x(P) + 1Next JForm1.Print "个位数的个数”"For J = 1 To 10P = JIf J = 10 Then Ps = 0Form1.Print "个位数是" & P & "; 有; " & x(J) & "; 有个数; "Next JEnd Sub