3个回答
展开全部
Function F(X As Double) As Double
If X <= -2 Then
F = X * X
ElseIf X <= 2 Then
F = Abs(X)
ElseIf X <= 8 Then
F = X + 1
Else
F = -X
End If
End Function
If X <= -2 Then
F = X * X
ElseIf X <= 2 Then
F = Abs(X)
ElseIf X <= 8 Then
F = X + 1
Else
F = -X
End If
End Function
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Function Fx(x as double) as double
dim y as double
select case x
case is<=-2
y=x*x
case is<=2
y=abs(x)
case is<=8
y=x+1
case else
y=-x
end select
Fx=y
End Function
dim y as double
select case x
case is<=-2
y=x*x
case is<=2
y=abs(x)
case is<=8
y=x+1
case else
y=-x
end select
Fx=y
End Function
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询