vb关于检查算数表达式的圆括号是否配对并用COUNT统计
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/07/14 10:33:30
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
在下划线上填入相应的内容
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
在下划线上填入相应的内容
应该少了一个参数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 Su
下面是我的代码
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 Su
【填空题】检查输入的算术表达式中的圆括号是否配对,并显示相应的判断结果
pascal括号匹配描述 给定一个算术表达式,检查其中的圆括号是否配对,给出适当信息(正好:Yes,左括号多:Left,
编写一个表达式中括号是否正确配对的算法
括号配对检查问题对输入的一段C或者C++代码(只要求其中一种),检查各种括号是否配对,以及配对的情况.基本要求:对于输入
表达式括号匹配问题一个表达式中包括变量、常量、操作符、圆括号,圆括号可以嵌套,编写程序判断表达式中的括号是否正确匹配.输
分不多,数据结构,试写一个判别表达式中开、闭括号是否配对出现的算法.
编写一个判断算术表达式中开括号闭括号是否配对的算法
试写一个判别表达式中括号是否配对出现的算法.
“0”~“9”的VB表达式?
求这一题的VB表达式
VB 实现表达式的计算
c++ 题目;实现算数表达式的计算