杨汉昌吧 关注:0贴子:308
  • 0回复贴,共1
Private Sub Command1_Click()
Dim i, a, b, c As Integer
For i = 100 To 999
a = i \ 100
b = i \ 10 Mod 10
c = i Mod 10
If i = a * a * a + b * b * b + c * c * c Then List1.AddItem Str(i)
Next i
End Sub
Private Sub Command2_Click()
Dim i, a, n As Integer
n = 0
For i = 100 To 199
a = i * 100 + 47
If (a Mod 57 = 0) Or (a Mod 67 = 0) Then
List2.AddItem Str(a)
n = n + 1
End If
Next i
Text1.Text = n
End Sub
Private Sub Command3_Click()
Dim i, b, c, n As Integer
n = 0
For i = 10000 To 19997
b = i \ 100 Mod 10
c = i Mod 10
If (b = 4) And (c = 7) And ((i Mod 57 = 0) Or (i Mod 67 = 0)) Then
List3.AddItem Str(i)
n = n + 1
End If
Next i
Text2.Text = n
End Sub
Private Sub Command4_Click()
Dim i, s As Long
s = 0
For i = 100000 To 999999
If (i \ 10000 = i Mod 100) And (i Mod 7 = 0) Then
List4.AddItem Str(i)
s = s + i
End If
Next i
Text3.Text = s
End Sub


IP属地:上海1楼2017-03-13 14:00回复