下面程序的功能是:计算表达式1+3+5+…+(2n-1)的值,程序运行时在文本框Text1中输入n的值,计算结果在文本框Text2中输出。则程序中加框处的语句应分别更正为:
(1)__________________
(2)__________________
Private Sub Command1_Click()
Dim sum As Long,i As Integer,n As Integer
sum = 0
n =Val( Text1.Text)
For i =" 1" To 2 * n - 1 Step 2
sum =" sum" + 2
Next i
Text2.label=Str(sum)
End Sub
推荐试卷