#include <stdlib.h>
#include <iostream>
template<typename T> T MAX(T*p, const int n)
{
T maxdata(p[0]);
for (int i = 1; i < n; i++)
{
if (maxdata < p[i])
{
maxdata = p[i];
}
}
return maxdata;
}
/*int getmax(int *p, int n)
{
int max(0);
max = p[0];
for (int i = 0; i < 10; i++)
{
if (max<p[i])
{
max = p[i];
}
}
return max;
}*/
void main()
{
double a[10] = { 999.9,3,4,98,77,999,87,123,0,12 };
std::cout << MAX(a, 10) << std::endl;
system("pause");
}