重生天尊在异界纵横:这段代码哪里错了?

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/20 03:37:58
这段代码有什么问题?
我执行的时候numA返回的值总是正确,但是返回的numB的值总是0,怎么回事啊?

If limit < limitn Then
e = Text1.Text
f = Text2.Text
g = Text3.Text
h = Text4.Text
limit = limit + 1
incont = 0
numA = 0
numB = 0
Do While incont < 4
incont = incont + 1
If incont = 1 Then
X = e
Y = a
ElseIf incont = 2 Then
X = f
Y = b
ElseIf incont = 3 Then
X = g
Y = c
ElseIf incont = 4 Then
X = h
Y = d
End If
If X = Y Then
numA = numA + 1
If X <> Y And (X = a Or X = b Or X = c Or X = d) Then
numB = numB + 1
End If
End If
Loop
If numA = 4 Then
MsgBox "你猜对了!", , "强人!"
Label3.Caption = a
Label4.Caption = b
Label5.Caption = c
Label6.Caption = d
End If
pass = Text5.Text
Text5.Text = pass + vbCrLf & e & f & g & h & " " & numA & "A" & numB & "B"
End If

猜数字的?

如果你是RO的玩家,可以去找NEB大人.

她也做了一个这个用来对付RO里的这个问题.

关于问题,自己调试吧,这样才能提高,估计是算法有问题.祝好运!