填空题
下面的程序段是检查输入的算术表达式中圆括号是否配对,并显示相应的结果。本程序在文本框输入表达式,边输入,边统计,以输入回车符作为表达式输入结束,然后显示结果。
Dim countl /%
Private Sub Textl_KeyPress(KeyAscii As integer)
if 1="("Then
countl=countl+1
Eiseif 2 =")" Then
3
End if
if KeyAscii=13 then
if 4Then
Print "左右括号配对"
Elself 5Then
Print "左括号多于右括号" ; countl; "个"
Else
Print "右括号多于左括号";countl;"个"
End if
End if
End Sub