Private Sub Command1_Click()
For n = 4 To 32764 Step 2
For x = 3 To n / 2 Step 2
f = True
For i = 3 To Sqr(x)
If x Mod i = 0 Then f = False: Exit For
Next
If f = True Then
y = n - x
f = True
For i = 3 To Sqr(y)
If y Mod i = 0 Then f = False: Exit For
Next
If f = True Then
List1.AddItem Str(n) & "=" & Str(x) & "+" & Str(y)
Exit For
End If
End If
Next
Next
End Sub
控件只用一个 list 和一个 command