【程序设计】
第一个: 1的n次方+2的n次方+3的n次方+……
第二个: 随机产生6个30~40的随机数,并判断奇偶
第三个: 100以内所有奇数的和
万分感谢!!
Private Sub Command1_Click()
Dim n As Integer
Dim s As String
Randomize
For i = 1 To 6
n = Rnd * 11 + 30
s = IIf(n Mod 2 = 1, "å¥æ°", "å¶æ°")
List1.AddItem n & " æ¯" & s
Next i
End Sub
Private Sub Command1_Click()
For i = 1 To 100 Step 2
s = s + i
Next i
Print "Sum=1+3+5+...+99="; s
End Sub