#include <stdio.h> #include <stdlib.h> int y,m=-1,s,d;int main(int h,char**v){printf("%9s%5d\nSu Mo Tu We Th Fr Sa\n", "Jan\0Feb\0Mar\0Apr\0May\0Jun\0Jul\0Aug\0Sep\0Oct\0Nov\0Dec"+(m+=atoi(v[1]))*4, y=atoi(v[2]));d="&%&%&&%&%&"[m]-6+(m-1&&(y%400?(y%100&&(y%4?0:1)):1));if(m<2) y--;y=s=(y+y/4-y/100+y/400+"#&%(#&($')%'"[m]-34)%7;while(y--)printf(" ");for( ;-y<d;y--)printf("%2d%c",-y,(s-y)%7?0:'\n');puts("");return 0;}