更新时间:2023-12-03 21:53:21
大家好,我是小环,我来为大家解答以上问题。二级vb上机题库及答案,二级vb上机题库很多人还不知道,现在让我们一起来看看吧!
1、仅仅在窗体上放一个命令按钮(点按钮后结果在窗体上打印出来,只有3个数,6,60,90) Private Sub Command1_Click() Print "200以内的酉完全数" Print Dim n As Integer, i As Integer, k As Integer, j As Integer, min As Integer, a As Integer For n = 1 To 200 a = 0 For i = 1 To n - 1 If n Mod i = 0 Then If i < n / i Then min = i Else min = n / i End If For j = 1 To min If i Mod j = 0 And n / i Mod j = 0 Then k = j End If Next j If k = 1 Then a = a + i End If End If Next i If a = n Then Print n Next n End Sub。
本文到此讲解完毕了,希望对大家有帮助。