program phase05b

    variables
      a       : int;
      b       : int;
      c       : int;

    procedures
      sub ()  ;

begin

  procedure main

  begin
    write ("enter int: ");
    readln (a);
    write ("enter int: ");
    readln (b);
    write ("enter int: ");
    readln (c);
    writeln (a," ",b," ",c);
    call sub();
    writeln (a," ",b," ",c);
  end

  procedure sub

    variables
        temp     : int;

  begin
    writeln ("subroutine sub");
    writeln (a);
    writeln (b);
    writeln (c);
    if (a > b)
      then do
           temp := a;
           a := b;
           b := temp;
           end;
    if (b > c)
      then do
           temp := b;
           b := c;
           c := temp;
           if (a > b)
             then do
                  temp := a;
                  a := b;
                  b := temp;
                  end;
           end;
    return;
  end

end

