visual foxpro考试,速度帮忙

来源:百度知道 编辑:UC知道 时间:2024/05/15 16:35:11
*-------------------------------------------------------
*【程序填空】
*-------------------------------------------------------
*功能: 三角形的面积为:area=sqrt(s*(s-a)*(s-b)*(s-c)).
* 其中s=(a+b+c)/2,a、b、c为三角形三条边的长。
* 请在【】处添上适当的内容,使程序完整。
*-------------------------------------------------------
SET TALK OFF
clear
input "a=" to a
input "b=" to b
input "c=" to c
***********SPACE**********
【?】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
? '不能构成三角形'
***********SPACE**********
【?】
endif
***********SPACE**********
? "area="【?】area
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

? "area=",area
SET TALK ON
RETURN

12345