`

找出数组最小的那个

 
阅读更多

            List<int> arry = new List<int>() {-1,1,2,3,4,5,6,7,8,9};
            int min=arry[0];//初始化
            for (int i = 0; i < arry.Count; i++)
            {
                if (min>arry[i])
                {
                    min = arry[i];
                 
                }

            }
            Response.Write(min);

微软内置方法:min()

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics