Program Task;
Const N = 5;
Var a: Array [1..N] of LongInt;
i: Integer;
Function MinDigit(number: LongInt): Integer;
Var digits: Array of Integer;
num, min, i: Integer;
Begin
num := number;
While num <> 0 Do
Begin
num := num Div 10;
i := i + 1;
End;
SetLength(digits, i);
num := number;
For i := 0 To Length(digits) - 1 Do
Begin
digits[i] := num Mod 10;
num := num Div 10;End;
For i := 0 To Length(digits) - 1 Do
If digits[i] < digits[min] Then
min := i; Result := digits[min];
End;
Begin
WriteLn('Введите ', N, ' целых чисел через пробел');
For i := 1 To N Do
Read(a[i]);
For i := 1 To N Do
Write(MinDigit(a[i]), ' ');
End.