PTA使用函数找出数组中的最大值

本题要求实现一个找出整型数组中最大值的函数。

函数接口定义:

 
  

int FindArrayMax( int a[], int n );

其中a是用户传入的数组,n是数组a中元素的个数。函数返回数组a中的最大值

#include 
#define MAXN 10

int FindArrayMax( int a[], int n );

int main()
{
    int i, n;
    int a[MAXN];
    
    scanf("%d", &n);
    for( i=0; imax){
			max=a[i];
		}
	}
	return max;
}

你可能感兴趣的:(算法,数据结构)