您的位置:首页 > 编程语言 > ASP

asp实现取得数组中的最大值的代码

2007-08-08 00:00 489 查看
<%
'******************************
'函数:GetMax(str)
'参数:str,待处理的数字数组,以,分隔多了数字
'作者:阿里西西
'日期:2007/7/12
'描述:取得数组中的最大值
'示例:<%=GetMax("360,120,5,600,32")%>
'******************************
function GetMax(str)
num=split(str,",")
max=num(0)
for ii=0 to ubound(num)
if cint(num(ii))>cint(max) then max=num(ii)
response.write "num="&num(ii)&",max="&max&"<br />"
next
getmax=max
end function
%>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: