You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

203 lines
3.9 KiB

6 years ago
#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>");
6 years ago
else if(F==5&&G==1) printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>Ͷ<EFBFBD><EFBFBD><EFBFBD>\n");
else if(F==6&&G==1) printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>ͯ<EFBFBD><EFBFBD>\n");
else if(F==8&&G==1) printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
else if(F==10&&G==1) printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
6 years ago
else
6 years ago
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
6 years ago
}
using namespace std;
6 years ago
int main(void)
{
int year,d,j,Z,ds,dd,m,n,D,x,y,z,h,k,l,B,Z1,C;
6 years ago
Chongfu:
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
printf("\n<EFBFBD><EFBFBD> 1. <20><>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD> <20><>\n<EFBFBD><EFBFBD> 2. <20><>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD> <20><>\n<EFBFBD><EFBFBD> 3. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>\n<EFBFBD><EFBFBD> 4. <20><><EFBFBD>ڼ<EFBFBD><DABC><EFBFBD> <20><>\n<EFBFBD><EFBFBD> 5. <20>˳<EFBFBD><CBB3><EFBFBD><EFBFBD><EFBFBD> <20><>\n");
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
6 years ago
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
scanf("%d",&C);
if(C==1)
{
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=========<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=========");
printf("\a");
}
else
{
printf("\n=========<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=========");
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);
}
6 years ago
printf("\n<EFBFBD><EFBFBD>л<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>ã<EFBFBD>\n");
goto Chongfu;
6 years ago
}
if(C==2)
{
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");
}
6 years ago
printf("\n<EFBFBD><EFBFBD>л<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>ã<EFBFBD>\n");
goto Chongfu;
6 years ago
}
if(C==3)
{
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;
Z1=Y(h);
d=Z%7;
weekday(d);
holiday(y,z);
6 years ago
printf("\n<EFBFBD><EFBFBD>л<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>ã<EFBFBD>\n");
goto Chongfu;
6 years ago
}
if(C==4)
{
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>գ<EFBFBD>");
6 years ago
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;
6 years ago
printf("\n<EFBFBD><EFBFBD>л<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>ã<EFBFBD>\n");
}
if(C==5)
{
printf("\n<EFBFBD><EFBFBD>л<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>ã<EFBFBD>\n");
}
if(C!=1&&C!=2&&C!=3&&C!=4&&C!=5)
{
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
goto Chongfu;
6 years ago
}
6 years ago
}
6 years ago