#include<iostream>
//#include<iomanip>
//#include<cmath>
using namespace std;
template <class T>
T max(T a[],int n)
{
T max=a[0];
for (int i=0;i<n;i++)
if (a[i]>max)
max=a[i];
return max;
}
void main()
{
int a[4]={1,2,3,4};
cout<<"数组a[4]的最大元素为"<<max(a,4)<<endl;
char c[4]={'a','g','k','m'};
cout<<"数组c[4]的最大元素为"<<max(c,4)<<endl;
}