Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
36
Task/Nth/EasyLang/nth.easy
Normal file
36
Task/Nth/EasyLang/nth.easy
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
proc nth num . ordinal$ .
|
||||
num$ = num
|
||||
lastTwoDigits$ = substr num$ len num$ - 1 2
|
||||
lastDigit$ = substr num$ len num$ 1
|
||||
if lastTwoDigits$ = "11" or lastTwoDigits$ = "12" or lastTwoDigits$ = "13"
|
||||
ordinal$ = num$ & "th"
|
||||
elif lastDigit$ = "1"
|
||||
ordinal$ = num$ & "st"
|
||||
elif lastDigit$ = "2"
|
||||
ordinal$ = num$ & "nd"
|
||||
elif lastDigit$ = "3"
|
||||
ordinal$ = num$ & "rd"
|
||||
else
|
||||
ordinal$ = num$ & "th"
|
||||
.
|
||||
.
|
||||
print "0 to 25:"
|
||||
for i = 0 to 25
|
||||
call nth i ordinal$
|
||||
write ordinal$
|
||||
write " "
|
||||
.
|
||||
print ""
|
||||
print "250 to 265:"
|
||||
for i = 250 to 265
|
||||
call nth i ordinal$
|
||||
write ordinal$
|
||||
write " "
|
||||
.
|
||||
print ""
|
||||
print "1000 to 1025:"
|
||||
for i = 1000 to 1025
|
||||
call nth i ordinal$
|
||||
write ordinal$
|
||||
write " "
|
||||
.
|
||||
Loading…
Add table
Add a link
Reference in a new issue