Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

Algorithms/Find maximum/vb script method 4

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

function findMin(aa) Dim o_intMin o_intMin = aa(0) for each p_intJ in aa if p_intJ < o_intMin then o_intMin = p_intJ end if next findMin = o_intMin end function function findMax(aa) Dim p_intI p_intI = 0 for each x in aa aa(p_intI) = x * -1 p_intI = p_intI + 1 next findMax = findMin(aa) * -1 end function Dim cc(4) cc(0) = 1 cc(1) = 2 cc(2) = 6 cc(3) = 4 cc(4) = 1 document.write(findMax(cc))