我想求数组里的最大值,但是为什么每次输出的都是0呢

img

晕,你写着大大的 return 0;啊!!!
改成return max;啊

因为你函数里return 0

img