15电气李丹【10个随机数求和】
1.打开VB6.0 2.窗体上插入一command button,双击并输入代码: 代码一 Private Sub Command1_Click()Dim i As Integer Dim a(10) As Integer Randomize For i = 1 To 10 a(i) = Int(Rnd * 1000) + 1 Sum = Sum + a(i) Next i P