题目

下面是求三角形面积的VB程序,但有3处错误,请你找出来并修改。 Private Sub Command1_Click()     Dim As Single, b As Single, c As Single, p As Single, s As Single     a≡Val(Text1. Text)     b=Val(Text2. Text)     c=Val(Text3. Text)     p=(a+b+c)/2     If a<=p Or b>=p Or c>=p Then         Label1. Caption="不能构成三角形"     Else         s=Sqr(p*(p-a)*(p-b)*(p-c))*p         Label1. Caption="面积为"& s     End If End Sub 答案:第一处:“Dim As Single”改为“Dim a As Single” 第二处:“If a<=p Or b>=p Оr c>=p Then”改为“If a>=p Or b>=p Or c>=p Then” 第三处:“s=Sqr(p*(p-a)*(p-b)*(p-c))*p”改为“s=Sqr(p*(p-a)*(p-b)*(p-c)
信息技术 试题推荐
最近更新