Write a function/method/subroutine/... that when given an integer greater than or equal to zero returns a string of the number followed by an apostrophe then the ordinal suffix.



Example

Returns would include 1'st 2'nd 3'rd 11'th 111'th 1001'st 1012'th



Task

Use your routine to show here the output for at least the following (inclusive) ranges of integer inputs:
0..25, 250..265, 1000..1025


Note: apostrophes are now optional to allow correct apostrophe-less English.




$ include "seed7_05.s7i";
 
const func string: suffix (in integer: num) is func
  result
    var string: suffix is "";
  begin
    if    num rem 10 = 1 and num rem 100 <> 11 then suffix := "st";
    elsif num rem 10 = 2 and num rem 100 <> 12 then suffix := "nd";
    elsif num rem 10 = 3 and num rem 100 <> 13 then suffix := "rd";
    else suffix := "th";
    end if;
   end func;
 
const proc: printImages (in integer: start, in integer: stop) is func
  local
    var integer: num is 0;
  begin
    for num range start to stop do
      write(num <& suffix(num) <& " ");
    end for;
    writeln;
  end func;
 
const proc: main is func
  begin
    printImages(   0,   25);
    printImages( 250,  265);
    printImages(1000, 1025);
  end func;