求一个数组里的最大元素,怎么我运出来是个R啊
#include <iostream>
#define M 4
using namespace std;
char fun(int a[][M])
{
int i, j, max = a[0][0];
for (i = 0; i < 2; i++)
for (j = 0; j < M; j++)
if (a[i][j]>= max) max = a[i][j];
return max;
}
int main()
{
int arr[2][M] = {5,8,3,45,76,-4,12,82};
cout << "max =" << fun(arr) << "\n";
}