编程计算1*2+3*4+5*6+7*8+9*10Private Sub command1_click()Dim s As Integer, i As Integers = 0For p = 1 To 10 Step 2For j = 2 To 10 Step 2 s = s + kNext jNext p Print s End Sub 怎么更改才对 要快

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/23 21:49:53
编程计算1*2+3*4+5*6+7*8+9*10PrivateSubcommand1_click()DimsAsInteger,iAsIntegers=0Forp=1To10Step2Forj=2To

编程计算1*2+3*4+5*6+7*8+9*10Private Sub command1_click()Dim s As Integer, i As Integers = 0For p = 1 To 10 Step 2For j = 2 To 10 Step 2 s = s + kNext jNext p Print s End Sub 怎么更改才对 要快
编程计算1*2+3*4+5*6+7*8+9*10
Private Sub command1_click()
Dim s As Integer, i As Integer
s = 0
For p = 1 To 10 Step 2
For j = 2 To 10 Step 2

s = s + k
Next j
Next p

Print s

End Sub


怎么更改才对 要快

编程计算1*2+3*4+5*6+7*8+9*10Private Sub command1_click()Dim s As Integer, i As Integers = 0For p = 1 To 10 Step 2For j = 2 To 10 Step 2 s = s + kNext jNext p Print s End Sub 怎么更改才对 要快
Dim s As Integer, p As Integer
s = 0
For p = 1 To 10 Step 2 '条件要注意一下的
s = s + p * (p + 1)
Next p
Debug.Print s