前往內容

演算法/查詢最大值/jscript 6

來自維基文庫,自由的開放式教科書
  function findMaxFourEle(i_intA,i_intB,i_intC,i_intD) {
     var o_intMax = i_intA;
     if ( i_intB > o_intMax )
        o_intMax = i_intB;
     if ( i_intC > o_intMax )
        o_intMax = i_intC;
     if ( i_intD > o_intMax )
        o_intMax = i_intD;     
     return o_intMax;
  } // end method
  function findMaxThreeEle(i_intA,i_intB,i_intC) {
     return findMaxFourEle(i_intA,i_intB,i_intC,i_intC);    
  } // end method     
  document.write(findMaxThreeEle(3,4,5));
華夏公益教科書