vf程序设计计算三角形面积和周长的程序!!急需!!

来源:百度知道 编辑:UC知道 时间:2024/07/04 17:46:11
vf程序设计计算三角形面积和周长的程序!!急需!!

SET TALK OFF
clear
input "a=" to a
input "b=" to b
input "c=" to c

if a+b>c and a+c>b and b+c>c
s=(a+b+c)/2
area=sqrt(s*(s-a)*(s-b)*(s-c))
else
? '不能构成三角形'
return
endif

? "此三角形的面积为:",area
?"此三解形的周长为:",2*s

SET TALK ON
RETURN

SET TALK OFF
clear
input "a=" to a
input "b=" to b
input "c=" to c

if a+b>c and a+c>b and b+c>c
s=(a+b+c)/2
area=sqrt(s*(s-a)*(s-b)*(s-c))
else
? '不能构成三角形'
return
endif

SET TALK ON