Program Task;
Const n = 5;
Var a: Array [1..n] of Integer;
i, min, max: Integer;
average: Real;
Begin
WriteLn('Введите ', n, ' целых чисел через пробел');
For i := 1 To n Do
Read(a[i]);
min := 1;
max := 1;
For i := 1 To n Do
Begin
If a[i] < a[min] Then
min := i;
If a[i] > a[max] Then
max := i;
End;
average := (a[min] + a[max]) / 2;
WriteLn('Результат: ', average:5:2);
ReadLn;
End.