level 1
悦悦呀🌜🌌
楼主
需要对运算的正确和错误次数进行计数,但是永远只显示正确一次或错误一次,到底是哪里写错了?
m = 0
n = 0
If (Val(Text1.Text) + Val(Text2.Text) = Val(Text3.Text) And Label2.Caption = "+") _
Or (Val(Text1.Text) - Val(Text2.Text) = Val(Text3.Text) And Label2.Caption = "-") Then
m = m + 1
Else
n = n + 1
End If
Label4.Caption = "你的答案:" & vbCrLf & "正确" & m & "次" & "错误" & n & "次"
2017年04月15日 12点04分
1
m = 0
n = 0
If (Val(Text1.Text) + Val(Text2.Text) = Val(Text3.Text) And Label2.Caption = "+") _
Or (Val(Text1.Text) - Val(Text2.Text) = Val(Text3.Text) And Label2.Caption = "-") Then
m = m + 1
Else
n = n + 1
End If
Label4.Caption = "你的答案:" & vbCrLf & "正确" & m & "次" & "错误" & n & "次"