在VB中:编写一个函数,求三个数中的最大值,要求定义max(x,y,z)函数
2个回答
展开全部
Function max(x as single, y as single, z as single)as single
Dim t As single
t = x
If y > t Then t = y
If z > t Then t = z
max = t
MsgBox "最大值" & max
End Function
Dim t As single
t = x
If y > t Then t = y
If z > t Then t = z
max = t
MsgBox "最大值" & max
End Function
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Function max(x as single, y as single, z as single) as single
Dim T As single
T = Iif( x > y, x, y)
max = Iif( T > z, T, z)
End Function
Dim T As single
T = Iif( x > y, x, y)
max = Iif( T > z, T, z)
End Function
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询