Заюзай такой вариант:
Code
Uses CRT;
Const MAX = 50;
Var B: Array[1..MAX] of Real;
i: Integer;
ne: Integer;
Function MaxNum(a: Array of Real; n: Integer): Integer;
Var max_e: Real;
max_i: Integer;
Begin
max_e := a[0];
max_i := 0;
For i := 1 to n-1 do
Begin
If (a[i] > max_e) then
Begin
max_e := a[i];
max_i := i;
End;
End;
MaxNum := max_i+1;
End;
Begin
ClrScr;
Randomize;
Write('Count of elements: '); Readln(ne);
Writeln('Array:');
For i := 1 to ne do
Begin
B[i] := Random * 5;
Write(B[i]:0:2, ' ');
End;
Writeln;
Writeln('MaxNum: ',MaxNum(B,ne), ' MaxVal: ',B[MaxNum(B,ne)]:0:2);
ReadKey;
End.