Getting Started with C # programming--Finding the minimum value of array maximums

Source: Internet
Author: User

The tool classes are as follows:

     Public classArrayhelper {#regionDouble array Maximum Value/// <summary>        ///double array Maximum value/// </summary>        /// <param name= "Array" ></param>        /// <returns></returns>         Public Static DoubleDoublemax (Double[] Array) {            if(Array = =NULL)                return 0; if(Array. Length <=0)                return 0; Doublemax = array[0];  for(inti =1; I < array. Length; i++)            {                if(Max <Array[i]) {Max=Array[i]; }            }            returnMax; }        #endregion        #regionDouble array Minimum value/// <summary>        ///double array Minimum value/// </summary>        /// <param name= "Array" ></param>        /// <returns></returns>         Public Static DoubleDoublemin (Double[] Array) {            if(Array = =NULL)                return 0; if(Array. Length <=0)                return 0; DoubleMin = array[0];  for(inti =1; I < array. Length; i++)            {                if(Min >Array[i]) {min=Array[i]; }            }            returnmin; }        #endregion        #regionint array Maximum Value/// <summary>        ///int array Maximum value/// </summary>        /// <param name= "num" ></param>        /// <returns></returns>         Public Static intIntmax (int[] num) {            if(num = =NULL)                return 0; if(Num. Length <=0)                return 0; intA = num[0];  for(inti =0; I < Num. Length; i++)            {                if(A <Num[i]) {a=Num[i]; }            }            returnA; }        #endregion        #regionint array Minimum value/// <summary>        ///int array Minimum value/// </summary>        /// <param name= "num" ></param>        /// <returns></returns>         Public Static intIntmin (int[] num) {            if(num = =NULL)                return 0; if(Num. Length <=0)                return 0; intA = num[0];  for(inti =0; I < Num. Length; i++)            {                if(A >Num[i]) {a=Num[i]; }            }            returnA; }        #endregion    }

Getting Started with C # programming--Finding the minimum value of array maximums

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.