cal by 51b

t[9];s[];main(x,d,w){for(t[3]=1;gets(s);w/36||puts(""))for(strptime(s,"%m%Y",t),w=t[6],d=!printf("%*s%*cSu Mo Tu We Th Fr Sa\n%*s",21-x,s,x=11-strftime(s,99,"%B %Y",t)/2,10,w*3,""),x="\x1f\x1d\x1f\x1e\x1f\x1e\x1f\x1f\x1e\x1f\x1e\x1f"[t[4]];d++<x;)printf("%2d%c",d,++w%7*(d-x)?32:10);}

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

download

return to the top page