明輝手游網(wǎng)中心:是一個(gè)免費(fèi)提供流行視頻軟件教程、在線(xiàn)學(xué)習(xí)分享的學(xué)習(xí)平臺(tái)!

一個(gè)求最大值與最小值的函數(shù)

[摘要]function max(info) arr=split(info,",") max=clng(arr(0)) for i=1 to ubound(arr) if clng(ar...
function max(info)
arr=split(info,",")
max=clng(arr(0))
for i=1 to ubound(arr)
if clng(arr(i))>clng(max) then
max=clng(arr(i))
end if
next
end function

function min(info)
arr=split(info,",")
min=clng(arr(0))
for i=1 to ubound(arr)
if clng(arr(i)) min=clng(arr(i))
end if
next
end function
'調(diào)用方式
'i=max("12,23,12,12,,32,43,54,43,56")
'i=min("12,12,23,3,454,34,4,5,45,3,232,3,2,43,4")