N'th: Difference between revisions
Content added Content deleted
(Added Algol W) |
(Added VTL-2) |
||
Line 4,355: | Line 4,355: | ||
250th 251st 252nd 253rd 254th 255th 256th 257th 258th 259th 260th 261st 262nd 263rd 264th 265th |
250th 251st 252nd 253rd 254th 255th 256th 257th 258th 259th 260th 261st 262nd 263rd 264th 265th |
||
1000th 1001st 1002nd 1003rd 1004th 1005th 1006th 1007th 1008th 1009th 1010th 1011th 1012th 1013th 1014th 1015th 1016th 1017th 1018th 1019th 1020th 1021st 1022nd 1023rd 1024th 1025th |
1000th 1001st 1002nd 1003rd 1004th 1005th 1006th 1007th 1008th 1009th 1010th 1011th 1012th 1013th 1014th 1015th 1016th 1017th 1018th 1019th 1020th 1021st 1022nd 1023rd 1024th 1025th |
||
</pre> |
|||
=={{header|VTL-2}}== |
|||
The subroutine at 2000 sets S and T to the first and second letters of the suffix for N. The subroutine at 3000 prints N and the suffix. |
|||
<syntaxhighlight lang="vtl2"> |
|||
1110 N=0 |
|||
1120 #=3000 |
|||
1130 N=N+1 |
|||
1140 #=N<26*1120 |
|||
1150 ?=" " |
|||
1210 N=250 |
|||
1220 #=3000 |
|||
1230 N=N+1 |
|||
1240 #=N<266*1220 |
|||
1250 ?=" " |
|||
1310 N=1000 |
|||
1320 #=3000 |
|||
1330 N=N+1 |
|||
1340 #=N<1026*1320 |
|||
1350 ?=" " |
|||
1400 #=9999 |
|||
2000 R=! |
|||
2010 S=116 |
|||
2020 T=104 |
|||
2030 M=N/100*0+% |
|||
2040 #=M<20+(M>4)=2*R |
|||
2050 M=N/10*0+% |
|||
2060 #=M=1=0*2100 |
|||
2070 S=115 |
|||
2080 T=116 |
|||
2090 #=R |
|||
2100 #=M=2=0*2140 |
|||
2110 S=110 |
|||
2120 T=100 |
|||
2130 #=R |
|||
2140 #=M=3=0*R |
|||
2150 S=114 |
|||
2160 T=100 |
|||
2170 #=R |
|||
3000 Z=! |
|||
3010 $=32 |
|||
3020 ?=N |
|||
3030 #=2000 |
|||
3040 $=S |
|||
3050 $=T |
|||
3060 #=Z |
|||
</syntaxhighlight> |
|||
{{out}} |
|||
<pre> |
|||
0th 1st 2nd 3rd 4th 5th 6th 7th 8th 9th 10th 11th 12th 13th 14th 15th 16th 17th 18th 19th 20th 21st 22nd 23rd 24th 25th |
|||
250th 251st 252nd 253rd 254th 255th 256th 257th 258th 259th 260th 261st 262nd 263rd 264th 265th |
|||
1000th 1001st 1002nd 1003rd 1004th 1005th 1006th 1007th 1008th 1009th 1010th 1011th 1012th 1013th 1014th 1015th 1016th 1017th 1018th 1019th 1020th 1021st 1022nd 1023rd 1024th 1025th |
|||
</pre> |
</pre> |
||