已知n是正整数:求n个不同整数中的最大元算法

参考:[http://www.crazycoder.cn/]比较次数: N-1
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#define MAX_LENGTH 100
/*Show usage*/
void usage(char * prog)
{
printf(\"%s Usage:\\n\", prog);
printf(\"%s <the count of numbers(should be less than 100)>\\n\", prog);
}
/*Try to find the max _disibledevent= find_max(list, length);
printf(\"The max one is: %d\\n\", max);
}
free(list);
return 1;
}
Tags:  已知n是正整数

延伸阅读

最新评论

发表评论