VB 利用for each...next循环语句,求 1+2+3+...+100的值 .
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/10/05 10:47:29
VB 利用for each...next循环语句,求 1+2+3+...+100的值 .
需要的控件:命令按钮,2个,command1,command2标签,2个,label1,label2command1代码:Private Sub Command1_Click()
Dim A(100) As Variant, B As Variant
Dim S As Integer
Dim I As Integer
For I = 1 To 100
A(I) = I
Next
S = 0
For Each B In A()
S = S + B
Next B
Label2.Caption = S
End Subcommand2代码:Private Sub Command2_Click()
End
End Sub已经运行过.
Dim A(100) As Variant, B As Variant
Dim S As Integer
Dim I As Integer
For I = 1 To 100
A(I) = I
Next
S = 0
For Each B In A()
S = S + B
Next B
Label2.Caption = S
End Subcommand2代码:Private Sub Command2_Click()
End
End Sub已经运行过.
VB 利用for each...next循环语句,求 1+2+3+...+100的值 .
利用循环语句for/next,求1+1/(2*2)+1/(3*3)+……+1/(m*m)的前20项的和 用VB
vb 循环语句For/next ,怎么计算?
VB循环语句求s=1+3+5+……+2n-1的值
求VB的循环语句
VB分别利用For和Do循环语句求s=1+1/2+1/4+1/7+1/11+1/16+1/22+……的值,当第i项的值
求VB中循环结构中 for i = 1 to 100 next i 中“next i ”的意思?是开始循环?还是?
VB FOR 循环语句
VB 2个FOR循环语句求解答
一个VB问题求,有关 for ...next .语句的.
VB for next语句
vb 循环for next的问题