给定一个数组,取出这个数组中的最大数:
C语言实现:
1: #include <stdio.h>
2:
3: int getMaxNum(int a[],int length)
4: {
5: int max = 0 ;
6: if(length <= 0)
7: {
8: return max ;
9:
本文介绍了如何在C语言和Java中实现寻找数组中最大数的算法,详细阐述了两种语言的实现过程。
给定一个数组,取出这个数组中的最大数:
C语言实现:
1: #include <stdio.h>
2:
3: int getMaxNum(int a[],int length)
4: {
5: int max = 0 ;
6: if(length <= 0)
7: {
8: return max ;
9:
1024
284

被折叠的 条评论
为什么被折叠?