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.




 
SUB sufijo (n)
    LET n = INT(n)
    LET NMod10 = MOD(n, 10)
    LET NMod100 = MOD(n, 100)
    IF (NMod10 = 1) AND (NMod100 <> 11) THEN
       LET sufi$ = "st"
    ELSE
       IF (NMod10 = 2) AND (NMod100 <> 12) THEN
          LET sufi$ = "nd"
       ELSE
          IF (NMod10 = 3) AND (NMod100 <> 13) THEN
             LET sufi$ = "rd"
          ELSE
             LET sufi$ = "th"
          END IF
       END IF
    END IF
    PRINT sufi$;
END SUB
 
SUB imprimeOrdinal (loLim, hiLim)
    LET loLim = INT(loLim)
    LET hiLim = INT(hiLim)
    FOR i = loLim TO hiLim
        PRINT i;
        CALL sufijo (i)
        PRINT " ";
    NEXT i
    PRINT
END SUB
 
CALL imprimeOrdinal (0, 25)
CALL imprimeOrdinal (250, 265)
CALL imprimeOrdinal (1000, 1025)
END
 