vb编写程序,利用随机函数产生并显示10 个1~100 之间的随机整数并找出这个数中的最大及该元素

编写程序,利用随机函数产生并显示10 个1~100 之间的随机整数:并找出这个数中的最大值及该元素对应的下标。(

Private Sub Command1_Click()
  Dim a(10) As Integer
  Randomize
  Max = 1
  For i = 1 To 10
    a(i) = 1 + Int(Rnd * 100)
    Print a(i);
    If a(i) > a(Max) Then Max = i
  Next i
  Print
  Print "a("; Max; ")="; a(Max)
End Sub

温馨提示:答案为网友推荐,仅供参考
第1个回答  2018-11-14
私聊我追问

....

相似回答