#include "stdio.h"
int ax[]
={1000,5,6,8,9,800,5,200,3,6,5,8,9};
int paixu (int n, int
ret)
{
if (n==0) return
ret>ax[0]?ret:ax[0];
int ret1= ret>ax[n]?
ret:ax[n];
return paixu(n-1,ret1);
}
int
main(int argc, char* argv[])
{
int
number=sizeof(ax)/sizeof(int);
printf("Hello World! %d
\n",sizeof(ax)/sizeof(int));
int
x=paixu(number,0);
printf("%d\n",x);
return 0;
}
不用遍历 递归算法 求数组中数字的最大值,布布扣,bubuko.com
时间: 2024-10-21 00:19:22