vb程序设计题目:时间双击窗体S=20+21+22+^+263,求S的值,并将结果储存到变量S中
问题描述:
vb程序设计题目:时间双击窗体S=20+21+22+^+263,求S的值,并将结果储存到变量S中
答
Option Explicit
Private Sub Form_DblClick()
Dim i As Integer
Dim s As Long
For i = 20 To 263
s = s + i
Next i
Print "s=" & s
End Sub
结果:s=34526