该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
for(j=1;j<=mon[i];j++)
{cprintf("%3d ",j);
/*if((first+j-1)%7==0)putchar('\n');*/
}
/*first=(first+mon[i])%7;
if(first==0)first=7;*/
}
}
void month5_8()
{for(i=0;i<2;i++)
{window(2+i*w,3,29+w*i,11);
textbackground(5);
clrscr();
textcolor(GREEN);
cprintf(" %s\n",month[i+4]);
gotoxy(1,2);cprintf(" Mon Tue Wed Thu Fri Sat Sun");
gotoxy(4*(fd[i+4]-1)+1,3);
for(j=1;j<=mon[i+4];j++)
{cprintf("%3d ",j);
/*if((first+j-1)%7==0)putchar('\n');*/
}
/*first=(first+mon[i+4])%7;
if(first==0)first=7;*/
}
for(i=2;i<4;i++)
{window(2+(i-2)*w,13,29+w*(i-2),21);
textbackground(5);
clrscr();
textcolor(GREEN);
cprintf(" %s",month[i+4]);
gotoxy(1,2);cprintf(" Mon Tue Wed Thu Fri Sat Sun");
gotoxy(4*(fd[i+4]-1)+1,3);
for(j=1;j<=mon[i+4];j++)
{cprintf("%3d ",j);
/*if((first+j-1)%7==0)putchar('\n');*/
}
/*first=(first+mon[i+4])%7;
if(first==0)first=7;*/
}
}
void month9_12()
{for(i=0;i<2;i++)
{window(2+i*w,3,29+w*i,11);
textbackground(5);
clrscr();
textcolor(GREEN);
cprintf(" %s\n",month[i+8]);
gotoxy(1,2);cprintf(" Mon Tue Wed Thu Fri Sat Sun");
gotoxy(4*(fd[i+8]-1)+1,3);
for(j=1;j<=mon[i+8];j++)
{cprintf("%3d ",j);
/*if((first+j-1)%7==0)putchar('\n');*/
}
/*first=(first+mon[i+8])%7;
if(first==0)first=7;*/
}
for(i=2;i<4;i++)
{window(2+(i-2)*w,13,29+w*(i-2),21);
textbackground(5);
clrscr();
textcolor(GREEN);
cprintf(" %s",month[i+8]);
gotoxy(1,2);cprintf(" Mon Tue Wed Thu Fri Sat Sun");
gotoxy(4*(fd[i+8]-1)+1,3);
for(j=1;j<=mon[i+8];j++)
{cprintf("%3d ",j);
/*if((first+j-1)%7==0)putchar('\n');*/
}
/*first=(first+mon[i+8])%7;
if(first==0)first=7;*/
}
}
void calendar(int year)
{int x,cha;
long day=0;
window(1,2,80,22);
textbackground(YELLOW);
clrscr();
if(year<2007)
{for(x=year;x<2007;x++)
{if((x%4==0&&x%100!=0)||x%400==0)
day+=366;
else day+=365;}
cha=day%7;
first=(7+1-cha)%7;
if(first==0)first=7;
}
if(year==2007)first=1;
if(year>2007)
{for(x=2007;x
{if((x%4==0&&x%100!=0)||x%400==0)
day+=366;
else day+=365;}
cha=day%7;
first=(1+cha)%7;
if(first==0)first=7;
}
if((year%4==0&&year%100!=0)||year%400==0)
mon[1]=29;
else mon[1]=28;
fd[0]=first;
for(j=1;j<12;j++)
{fd[j]=(fd[j-1]+mon[j-1])%7;
if(fd[j]==0)fd[j]=7;}
month1_4();}
void jiance2(int n)
{void nian(int year);
switch(n)
{case 0:getch( );quzhi();calendar(year);nian(year);break;
case 1:month1_4();break;
case 2:month5_8();break;
case 3:month9_12();break;
case 4:exit(0);break;
default:exit(0);}
}
void ping()
{clrscr();
window(1,1,80,1);
textbackground(RED);