witam mam programik i w jednym miejscu, gdzie szuka najwyzszej sredniej potrzebuje zeby zwracal numer indeksu tej najwyzszej sredniej i nie wiem jak to zrobic
Function SredniaPrzedmiotu(pomocOceny:tabOceny):real;
Var i,j:byte;
suma:array[1..W]of real;
c,max:real;
Begin
For i:=1 to W Do suma[i]:=0;
For i:=1 to K Do
For j:=1 to W Do Begin
suma[i]:=(suma[i]+pomocOceny[j,i]);
End;
For i:=1 To K Do suma[i]:=suma[i]/W;
c:=suma[1];
For i:=2 To W Do Begin
If c> suma[i] Then max:=c Else max:=suma[i];
c:=max;
End;
SredniaPrzedmiotu:=c;
End;
pozdrawiam