给出以下四个问题:①输入一个数x,输出它的相反数;②求面积为6的正方形的周长;

给出以下四个问题:①输入一个数x,输出它的相反数;②求面积为6的正方形的周长;

③求三个数a,b,c中的最大数;④求函数 的函数值.

其中不需要用条件语句来描述其算法的有 个

问答/170℃/2022-07-30 10:09:17

优质解答:

1、

input x

print -x

end

2、

s=6

a=sqr(s)

l=6a

print l

end

3、这个要用条件语句if.then.

input a,b ,c

if b>a tnen

t=a

a=b

b=t

end if

tf c>a then

t=a

a=c

c=t

end if

tf c>b then

t=b

b=c

c=t

end tf

print a,b,c

end

4、这个x是事先给定的,不要用用条件语句.

x=a

l=f(x)

print l

end

只有1 个要用条件语句.

我来回答

猜你喜欢

Copyright © 作文乐园 Inc.
Www.821218.Com All Rights Reserved
网站、品牌合作请联系