1. 程序要求及程序代码如下: ( 1 )窗体 Form1.frm 的程序功能是:输出 20 个随机正实数,然后分别计算输出并当输出它们的整数部分和小数部分之和。 ( 2 )程序有 2 处错误,错误均在“ '*ERROR* ”注释行,请直接在该行修改,不得增加或减少数,也不得删除或修改错误标记 '*ERROR* 。 Private Sub Form_Click() Dim a(20) As Double, str As String Dim i As Integer, sum1 As Long, sum2 As Single Randomize For i = 1 To 20 a(i) = Int(Rnd * 1000) / 100 str = str & Format(a(i), "0.00") & " " If i Mod 5 = 0 Then str = str & vbCrLf sum1 = sum1 + a(i) '*ERROR* sum2 = sum2 + a(i) - Int(a(i)) Next i Print " 原始数据为: " & vbCrLf Print a(i) '*ERROR* Print " 整数部分之和为: "; sum1 Print " 小数部分之和为: "; sum2 End Sub