Counting adventure by 51b

#define x ,"six","seven","eigh"
#define y ,"ten","eleven","twel"
*s[]={"","one","two","three","four","five"x"t","nine"y"ve","twen","thir","for","fif"x,"nine","one hundred","first","second","third","four","fif"x,"nin"y"f"},*q,*r;m;f(m,p){return m<13|m>99?"":m<20?"teen":m%10?"ty-":p;}main(n,l){for(scanf("%d",&n);m++<n;printf("The %s%s%s%s positive integer is %s%s%s.\n",m<13?s[m+21]:q,f(m,"tie"),s[l?m%10+21:0],m/10-1&&(m-1)%10<3?"":"th",m<13?s[m]:q,f(m,"ty"),s[l?m%10:0]))q=m-14?s[m<20?m+1:m/10+11]:"four",l=m>19&&m%10;}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page