|
发表于 2020-2-7 12:30:01
|
显示全部楼层
''1
Option Explicit
Private Sub Form_Load()
Dim m As Long, n As Long
Dim Temp As String
Dim Str1 As String, Str2 As String, Str3 As String
Str1 = "378"
For m = 1 To 3
n = Val(Mid(Str1, m, 1))
Temp = CStr(n - 1)
If Temp < 0 Then Temp = ""
If InStr(1, Str1, Temp) = 0 And InStr(1, Str2, Temp) = 0 Then Str2 = Str2 & Temp
Temp = CStr(n + 1)
If Temp > 9 Then Temp = ""
If InStr(1, Str1, Temp) = 0 And InStr(1, Str2, Temp) = 0 Then Str2 = Str2 & Temp
Next m
For m = 0 To 9
If InStr(1, Str1 & Str2, CStr(m)) = 0 Then Str3 = Str3 & CStr(m)
Next m
Debug.Print Str1, Str2, Str3
End Sub
|
|