program phase05c

    variables
      x       : real;
      y       : real;
      a       : int;
      b       : int;
      c       : int;

    procedures
      f   ()  : real;
      sub ()  ;

begin

  procedure main

      variables
        z        : real;

  begin

    write ("enter real: ");
    readln (x);
    write ("enter real: ");
    readln (y);
    z := f ();
    writeln (x," ",y," f = ",z);
    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 f

  begin
    writeln ("function f");
    writeln (x);
    writeln (y);
    return x*y;
  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

