int theMax(int a[],int n)
{
int t;
if(n>1)
{
t=f(a,n-1);
return t>a[n-1]?t:a[n-1];
}
else
return a[0];
}
利用递归返回数组中的最大值
最新推荐文章于 2024-04-19 18:21:05 发布
int theMax(int a[],int n)
{
int t;
if(n>1)
{
t=f(a,n-1);
return t>a[n-1]?t:a[n-1];
}
else
return a[0];
}