|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <windows.h>
|
|
|
|
|
#include <iostream>
|
|
|
|
|
int Y(int Z) //<2F>ԪԪ<D4AA><D4AA>Ԫ<EFBFBD><D4AA>1<EFBFBD>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
int i,s=0,day;
|
|
|
|
|
for(i=1;i<=Z-1;i++)
|
|
|
|
|
{
|
|
|
|
|
if(i%4==0&&i%100!=0||i%400==0)
|
|
|
|
|
day=366;
|
|
|
|
|
else
|
|
|
|
|
day=365;
|
|
|
|
|
s=s+day;
|
|
|
|
|
}
|
|
|
|
|
return s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int month(int X,int C) //<2F>·ݣ<C2B7><DDA3><EFBFBD>ƽ<EFBFBD><C6BD><EFBFBD>꣩
|
|
|
|
|
{
|
|
|
|
|
int V;
|
|
|
|
|
switch(C)
|
|
|
|
|
{
|
|
|
|
|
case 1: V=31;break;
|
|
|
|
|
case 2:
|
|
|
|
|
if(V%4==0&&V%100!=0||V%400==0)
|
|
|
|
|
V=29;
|
|
|
|
|
else
|
|
|
|
|
V=28;
|
|
|
|
|
break;
|
|
|
|
|
case 3: V=31;break;
|
|
|
|
|
case 4: V=30;break;
|
|
|
|
|
case 5: V=31;break;
|
|
|
|
|
case 6: V=30;break;
|
|
|
|
|
case 7: V=31;break;
|
|
|
|
|
case 8: V=31;break;
|
|
|
|
|
case 9: V=30;break;
|
|
|
|
|
case 10: V=31;break;
|
|
|
|
|
case 11: V=30;break;
|
|
|
|
|
case 12: V=31;break;
|
|
|
|
|
}
|
|
|
|
|
return V;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int weekday(int V) //<2F>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
switch(V)
|
|
|
|
|
{
|
|
|
|
|
case 1: printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ\n");printf("\a");break;
|
|
|
|
|
case 2: printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڶ<EFBFBD>\n");printf("\a");break;
|
|
|
|
|
case 3: printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");printf("\a");break;
|
|
|
|
|
case 4: printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");printf("\a");break;
|
|
|
|
|
case 5: printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");printf("\a");break;
|
|
|
|
|
case 6: printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");printf("\a");break;
|
|
|
|
|
case 7: printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");printf("\a");break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int holiday(int F,int G) //<2F>жϸ<D0B6><CFB8><EFBFBD><EFBFBD>Ƿ<EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
if(F==1&&G==1) printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ΪԪ<EFBFBD><EFBFBD>");
|
|
|
|
|
else if(F==5&&G==1) printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>Ͷ<EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
else if(F==6&&G==1) printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>ͯ<EFBFBD><EFBFBD>");
|
|
|
|
|
else if(F==8&&G==1) printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
else if(F==10&&G==1) printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
else
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD>첻<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
int year,d,j,Z,ds,dd,m,n,D,x,y,z,h,k,l,B,Z1;
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD>");
|
|
|
|
|
scanf("%d",&year);
|
|
|
|
|
if((year%4==0&&year%100!=0)||year%400==0)
|
|
|
|
|
{
|
|
|
|
|
printf("\n <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
printf("\a");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
printf("\n <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƽ<EFBFBD><C6BD>");
|
|
|
|
|
printf("\a");
|
|
|
|
|
}
|
|
|
|
|
Z=Y(year);
|
|
|
|
|
for(j=1;j<=12;j++)
|
|
|
|
|
{
|
|
|
|
|
d=Z%7;
|
|
|
|
|
printf("\n-----------------------------\n");
|
|
|
|
|
printf(" %d<>·<EFBFBD>\n",j);
|
|
|
|
|
printf("SUN MON TUE WED THU FRI SAT\n");
|
|
|
|
|
if(d<6)
|
|
|
|
|
for(ds=1;ds<=d+1;ds++)
|
|
|
|
|
printf(" ");
|
|
|
|
|
for(dd=1;dd<=month(year,j);dd++)
|
|
|
|
|
{
|
|
|
|
|
printf ("%d",dd);
|
|
|
|
|
if (dd<10)
|
|
|
|
|
printf(" ");
|
|
|
|
|
else
|
|
|
|
|
printf(" ");
|
|
|
|
|
if (dd==6-d||(dd-6+d)%7==0||dd==month(year,j))
|
|
|
|
|
printf("\n");
|
|
|
|
|
}
|
|
|
|
|
Z=Z+month(year,j);
|
|
|
|
|
}
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>£<EFBFBD>");
|
|
|
|
|
scanf("%d%d",&m,&n);
|
|
|
|
|
Z=Y(m);
|
|
|
|
|
for(j=1;j<=n-1;j++)
|
|
|
|
|
{
|
|
|
|
|
D=month(m,j);
|
|
|
|
|
Z=Z+D;
|
|
|
|
|
}
|
|
|
|
|
d=Z%7;
|
|
|
|
|
printf("\n-----------------------------\n");
|
|
|
|
|
printf(" %d<>·<EFBFBD>\n",j);
|
|
|
|
|
printf("SUN MON TUE WED THU FRI SAT\n");
|
|
|
|
|
if(d<6)
|
|
|
|
|
for(ds=1;ds<=d+1;ds++)
|
|
|
|
|
printf(" ");
|
|
|
|
|
for(dd=1;dd<=month(year,j);dd++)
|
|
|
|
|
{
|
|
|
|
|
printf("%d",dd);
|
|
|
|
|
if(dd<10)
|
|
|
|
|
printf(" ");
|
|
|
|
|
else
|
|
|
|
|
printf(" ");
|
|
|
|
|
if(dd==6-d||(dd-6+d)%7==0||dd==month(year,j))
|
|
|
|
|
printf("\n");
|
|
|
|
|
}
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>գ<EFBFBD>");
|
|
|
|
|
scanf("%d%d%d",&x,&y,&z);
|
|
|
|
|
Z=Y(x);
|
|
|
|
|
for(j=1;j<=y-1;j++)
|
|
|
|
|
{
|
|
|
|
|
D=month(x,j);
|
|
|
|
|
Z=Z+D;
|
|
|
|
|
}
|
|
|
|
|
Z=Z+z;
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD>뵱ǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>գ<EFBFBD>");
|
|
|
|
|
scanf("%d%d%d",&h,&k,&l);
|
|
|
|
|
Z1=Y(h);
|
|
|
|
|
for(j=1;j<=k-1;j++)
|
|
|
|
|
{
|
|
|
|
|
D=month(k,j);
|
|
|
|
|
Z1=Z1+D;
|
|
|
|
|
}
|
|
|
|
|
Z1=Z1+l;
|
|
|
|
|
B=Z1-Z;
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ھ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>%d<><64>\n",B);
|
|
|
|
|
d=Z%7;
|
|
|
|
|
weekday(d);
|
|
|
|
|
holiday(y,z);
|
|
|
|
|
}
|
|
|
|
|
|