//在int数组arr中找最大值
int Max(const int* arr, int len)
{
int tmp = arr[0];//保存最大值
for (int i = 0; i < len; i++)
{
if (arr[i] > tmp)
tmp = arr[i];
}
return tmp;
}
int main()
{
int arr[] = {1,3,7,89,0,23,45,67};
int t = Max(arr,sizeof(arr)/sizeof(arr[0]));
printf("%d\n",t);
return 0;
}