转到内容

算法/求最大值/vb script 方法 1

来自 WikiBooks,开放世界开放书籍

<script type="text/vbscript">

   function findMax(aa)
      Dim o_intMax
      o_intMax = aa(0)
      for each p_intJ in aa
         if p_intJ > o_intMax then
             o_intMax = p_intJ
         end if
      next
      findMax = o_intMax
   end function    
   Dim cc(3)
   cc(0) = 3
   cc(1) = 6
   cc(2) = 5
   cc(3) = 1
   document.write("Max is " & findMax(cc) )    
 </script>
华夏公益教科书