上传者: 43934844
|
上传时间: 2022-06-20 18:04:43
|
文件大小: 70KB
|
文件类型: DOC
累加求和1到100 Private Sub Command1_Click() Dim i As Integer, sum As Integer sum = 0 For i = 1 To 100 sum = sum + i Next Text1.Text = sum End Sub Private Sub Command2_Click() End End Sub 1到100的奇数和 Private Sub Command1_Click() Dim i As Integer, sum As Integer sum = 0 For i = 1 To 100 step 2 sum = sum + i Next Text1.Text = sum End Sub Private Sub Command2_Click() End 求n! Private Sub Command1_Click() Dim fact As Double, n As Integer, i As Integer n = Val(Text1.Text) fact = 1 For i = 1 To n fact = fact *