数组排序最大元素

double calcMax (double arr[], unsigned arrSize)
    {
        unsigned    idxMax = 0;
        for (unsigned i = 0; i < arrSize; ++i) {
            if (arr[i] > arr[idxMax]) {
                idxMax = i;
            }
        }

        return (arr[idxMax]);
    }

 

posted @ 2018-01-31 02:37  Bear_Guo  阅读(131)  评论(0编辑  收藏  举报