vb关于检查算数表达式的圆括号是否配对并用COUNT统计Dim count1%Private Sub Text1_KeyPress(KeyAscii As Integer)if_________="(" then count1=count1+1elseif ________=")" then _______End IfIf KeyAscii = 13 Thenif ________ then Print "
来源:学生作业帮助网 编辑:作业帮 时间:2024/07/28 03:25:47
![vb关于检查算数表达式的圆括号是否配对并用COUNT统计Dim count1%Private Sub Text1_KeyPress(KeyAscii As Integer)if_________=](/uploads/image/z/6500-20-0.jpg?t=vb%E5%85%B3%E4%BA%8E%E6%A3%80%E6%9F%A5%E7%AE%97%E6%95%B0%E8%A1%A8%E8%BE%BE%E5%BC%8F%E7%9A%84%E5%9C%86%E6%8B%AC%E5%8F%B7%E6%98%AF%E5%90%A6%E9%85%8D%E5%AF%B9%E5%B9%B6%E7%94%A8COUNT%E7%BB%9F%E8%AE%A1Dim+count1%25Private+Sub+Text1_KeyPress%28KeyAscii+As+Integer%29if_________%3D%22%28%22+then+count1%3Dcount1%2B1elseif+________%3D%22%29%22+then+_______End+IfIf+KeyAscii+%3D+13+Thenif+________+then+Print+%22)
vb关于检查算数表达式的圆括号是否配对并用COUNT统计Dim count1%Private Sub Text1_KeyPress(KeyAscii As Integer)if_________="(" then count1=count1+1elseif ________=")" then _______End IfIf KeyAscii = 13 Thenif ________ then Print "
vb关于检查算数表达式的圆括号是否配对并用COUNT统计
Dim count1%
Private Sub Text1_KeyPress(KeyAscii As Integer)
if_________="(" then count1=count1+1
elseif ________=")" then _______
End If
If KeyAscii = 13 Then
if ________ then Print " 左右括号配对"
elseif _________ then print "左括号多于右括号"; count1;"个"
Else:Print "右括号多于左括号"; -count1; "个"
End If
End If
End Sub
在下划线上填入相应的内容
vb关于检查算数表达式的圆括号是否配对并用COUNT统计Dim count1%Private Sub Text1_KeyPress(KeyAscii As Integer)if_________="(" then count1=count1+1elseif ________=")" then _______End IfIf KeyAscii = 13 Thenif ________ then Print "
应该少了一个参数count2
下面是我的代码
Dim count1%
Dim count2%
Private Sub Text1_KeyPress(KeyAscii As Integer)
If Chr(KeyAscii) = "(" Then
count1 = count1 + 1
ElseIf Chr(KeyAscii) = ")" Then
count2 = count2 + 1
End If
If KeyAscii = 13 Then
If count1 = count2 Then
Print " 左右括号配对"
ElseIf count1 > count2 Then
Print "左括号多于右括号"; count1; "个"
Else
Print "右括号多于左括号"; -count1; "个"
End If
End If
End Sub