#include <stdio.h>
#include <time.h>
int main(int argc, char** argv)
{
time_t t0;
struct tm t;
char w[7][5]={ "sun","mon","tur","wen","thu","fri","sta" };
char m[12][4]={ "Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec" };
t.tm_min=0;
t.tm_sec=0;
t.tm_hour=0;
t.tm_year=2004-1900;
t.tm_mday=1;
t.tm_mon=0;
t0=mktime(&t);
int i,j,k;
for(i=0;i<12;i++)
{
printf("%s\n",m[i]);
for(j=0;j<7;j++)printf("%s\t",w[j]);
printf("\n");
for(k=0;k<t.tm_wday;k++)printf("\t");
while(t.tm_mon==i)
{
printf("%d\t",t.tm_mday);
if(t.tm_wday==6)printf("\n");
t0+=3600*24;
t=*gmtime(&t0);
}
printf("\n");
}
return 0;
}