作业帮 > 数学 > 作业

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

来源:学生作业帮 编辑:搜搜做题作业网作业帮 分类:数学作业 时间:2024/08/19 11:46:50
给出以下四个问题:①输入一个数x,输出它的相反数;②求面积为6的正方形的周长;
③求三个数a,b,c中的最大数;④求函数 的函数值.
其中不需要用条件语句来描述其算法的有 个
给出以下四个问题:①输入一个数x,输出它的相反数;②求面积为6的正方形的周长;
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 个要用条件语句.