#include <stdio.h>
#include <stdlib.h>

#define MAX 6
#define SENTINELLE -1

int * rechMax (int *x);

int main (void)
{
	int tab[6] = {17, 12, 3, 14, 8, 6};
	int i = 0;
	int *ptr;

	while (i < MAX)
	{
		ptr = rechMax (tab);
		printf ("%d\n", *ptr);
		*ptr = SENTINELLE;
		i++;
	}
	
	return EXIT_SUCCESS;
}

int * rechMax (int *t)
{
	int *p = t;
	int j = 1;
	
	while (j < MAX)
	{
		if (*(t + j) > *p)
		{
			p = t + j;
		}
		
		j++;
	}
	
	return p;
}

