一道关于VF的题
答案:2 悬赏:30 手机版
解决时间 2021-11-23 14:28
- 提问者网友:遁入空寂
- 2021-11-23 08:11
一道关于VF的题
最佳答案
- 五星知识达人网友:爱难随人意
- 2021-11-23 08:35
clear
?"请输入3条变长:"
input "a=" to a
input "b=" to b
input "c=" to c
if sjxtest(a,b,c)
l=(a+b+c)/2
s=sqrt(l*(l-a)*(l-b)*(l-c))
?"三边可以构成三角形,面积为:s=",s
else
?"三边不可以构成三角形"
endif
function sjxtest(x,y,z)
if x+y>z and y+z>x and z+x>y
test=.t.
else
test=.f.
endif
return test
endfunction
?"请输入3条变长:"
input "a=" to a
input "b=" to b
input "c=" to c
if sjxtest(a,b,c)
l=(a+b+c)/2
s=sqrt(l*(l-a)*(l-b)*(l-c))
?"三边可以构成三角形,面积为:s=",s
else
?"三边不可以构成三角形"
endif
function sjxtest(x,y,z)
if x+y>z and y+z>x and z+x>y
test=.t.
else
test=.f.
endif
return test
endfunction
全部回答
- 1楼网友:妄饮晩冬酒
- 2021-11-23 09:33
clear
set talk off
input "a=" to a
input "b=" to b
input "c=" to c
L=(a+b+c)/2
if a+b>c and a+c>b and b+c>a
area=sqrt(L*(L-A)*(L-B)*(L-C))
?"此三角形面积是:",area
else
?"此三个数不能构成三角形,数据错误!"
endif
set talk on
return
set talk off
input "a=" to a
input "b=" to b
input "c=" to c
L=(a+b+c)/2
if a+b>c and a+c>b and b+c>a
area=sqrt(L*(L-A)*(L-B)*(L-C))
?"此三角形面积是:",area
else
?"此三个数不能构成三角形,数据错误!"
endif
set talk on
return
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯