Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
28
Task/Nth/BASIC256/nth.basic
Normal file
28
Task/Nth/BASIC256/nth.basic
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
function ordinal(n)
|
||||
ns$ = string(n)
|
||||
begin case
|
||||
case right(ns$, 1) = "1"
|
||||
if right(ns$, 2) = "11" then return ns$ + "th"
|
||||
return ns$ + "st"
|
||||
case right(ns$, 1) = "2"
|
||||
if right(ns$, 2) = "12" then return ns$ + "th"
|
||||
return ns$ + "nd"
|
||||
case right(ns$, 1) = "3"
|
||||
if right(ns$, 2) = "13" then return ns$ + "th"
|
||||
return ns$ + "rd"
|
||||
else
|
||||
return ns$ + "th"
|
||||
end case
|
||||
end function
|
||||
|
||||
subroutine imprimeOrdinal(a, b)
|
||||
for i = a to b
|
||||
print ordinal(i); " ";
|
||||
next i
|
||||
print
|
||||
end subroutine
|
||||
|
||||
call imprimeOrdinal (0, 25)
|
||||
call imprimeOrdinal (250, 265)
|
||||
call imprimeOrdinal (1000, 1025)
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue