#include
void main()
{
FILE *fpin,*fpout;
int a,i,j,m=0,mon,l,k;
fpin=freopen("c:\\TC\\work\\c.in","r",stdin);
fpout=freopen("c:\\TC\\work\\c.out","w",stdout);
while(scanf("%d",&a)==1)
{
for(i=1;i<=a;i++)
{
printf("\n YEAR %d ",i);
for(j=1;j<=12;j++)
{
if(i%4==0&&j==2)
mon=29;
else if(j==2)
mon=28;
else if(j==1||j==3||j==5||j==7||j==8||j==10||j==12)
mon=31;
else
mon=30;
if(j==1)
printf("\n\n JANUARY ");
else if(j==2)
printf("\n\n FEBRUARY ");
else if(j==3)
printf("\n\n MARCH ");
else if(j==4)
printf("\n\n APRIL ");
else if(j==5)
printf("\n\n MAY ");
else if(j==6)
printf("\n\n JUNE ");
else if(j==7)
printf("\n\n JULAY ");
else if(j==8)
printf("\n\n AUGUST ");
else if(j==9)
printf("\n\n SEPTEMBER ");
else if(j==10)
printf("\n\n OCTOBER ");
else if(j==11)
printf("\n\n NOVEMBER ");
else if(j==12)
printf("\n\n DECEMBER ");
printf("\n SUN MON TUE WED THU FRI SAT\n");
printf(" ");
for(l=1;l<=m;l++)
{
printf(" ");
}
for(k=1;k<=mon;k++)
{
printf("%2d ",k);
m++;
if(m==7)
{
printf("\n");
printf(" ");
m=0;
}
}
// printf("\n");
}
// printf("\n%d",a*3);
}
}
}
0 comments:
Post a Comment