Private Sub Command1_Click()
Dim i As Long, j As Long, k As Long
For i = 100 To 999
For j = 100 To 999
If Abs(i - j) < 8 And j >= i Then
If Abs(i - j) = 0 Or Abs(i - j) = 1 Or Abs(i - j) = 3 Or Abs(i - j) = 5 Then
If (i + j) <> 1948 And (1948 Mod (i + j) = 0) Then Me.Print Abs(i - j), i * 1000 + j
End If
If Abs(i - j) = 2 Or Abs(i - j) = 4 Or Abs(i - j) = 6 Then
If (i + j) = 1948 Then Me.Print Abs(i - j), i * 1000 + j
End If
End If
Next
Next
End Sub
5 241246
3 242245
1 243244
0 487487
6 971977
4 972976
2 973975