Asp在任意几个数字中求最大值与最小值函数asp

/ / 2016-02-05   阅读:2559
<% Function   Max(Price)  Dim   n,   m  If   UBound(Price)   >   0   Then  m   =   Price(0)  For   n   =   1 &...
<% Function   Max(Price) 
Dim   n,   m 
If   UBound(Price)   >   0   Then 
m   =   Price(0) 
For   n   =   1   To   UBound(Price) 
If   Price(n)   >   m   Then   m   =   Price(n) 
Next 
Max   =   m 
Else 
Max   =   Null 
End   If 
End   Function
Function   Min(Price) 
Dim   n,   m 
If   UBound(Price)   >   0   Then 
m   =   Price(0) 
For   n   =   1   To   UBound(Price) 
If   Price(n)   <   m   Then   m   =   Price(n) 
Next 
Min   =   m 
Else 
Min   =   Null 
End   If 
End   Function 
Dim   ary 
ary   =   Array(12,13,41,61,8,38,90) 
Response.Write   Max(ary) 
Response.Write   " <BR><BR> " 
Response.Write   Min(ary) %>

我要评论

昵称:
验证码:

最新评论

共0条 共0页 10条/页 首页 上一页 下一页 尾页
意见反馈