Program Max;
Const first = 1; last = 10;
Var a: Array [first..last] Of Integer;
m, tmp, i: Integer;
Begin
WriteLn('Введите через пробел ', last, ' чисел');
For i := first To last Do
Read(a[i]);
m := first;
For i := first To last Do
If a[i] > a[m] Then
m := i;
tmp := a[last];
a[last] := a[m];
a[m] := tmp;
WriteLn('Результат:');
For i := first To Last Do
Write(a[i], ' ');
ReadLn;
End.