uses crt;
var a:array[1..10] of Integer;
i,j:Integer;
procedure rep; var k:Integer; begin k:=a[ i];a[ i]:=a[j];a[j]:=k; end;
begin
randomize;clrscr;
for i:=1 to 10 do a[ i]:=random(101);
for i:=1 to 9 do for j:=i+1 to 10 do if a[ i] mod 10 > a[ j] mod 10 then rep;
for i:=1 to 10 do write(a[ i],' ');
end.