Feu una funció que retorni la posició de l’element màxim de
@v[0..m]@. En cas d’empat, cal retornar la posició més petita.
Precondició
@m@
mida de v.
Interfície
C++
int posicio_maxim(const vector<double>& v,int m);
C
int posicio_maxim(double v[],int m);
Java
publicstaticintposicioMaxim(double[] v,int m);
Python
posicio_maxim(v, m) # returns int
MyPy
posicio_maxim(v: list[float], m: int) ->int
Observació
Només cal enviar el procediment demanat; el programa principal serà
ignorat.
About statements
The official statement of a problem is always the one
in the PDF document. The HTML version of the statement
is also given to help you, but may contain some content
that is not well displayed. In case of doubt, always use the PDF.