汎用的にするならこうなるのかな
int Max(int * d, int n)
{
 int max = d[0];
 int i = 1;
 while(i < n){
  if (d[i] > max) {
   max = d[i];
  }
  i++;
 }
 return max;
}