#include
int main()
{
int c,x,num,year,month,day,j=1,k=1;
printf("请输入年:");
scanf("%d",&year);
printf("\n请输入月:");
scanf("%d",&month);
printf("\n请输入日:");
scanf("%d",&day);
printf("\n请输本年1月1号是星期几?:");
scanf("%d",&j);
printf("\n");
if(((year%4==0)&&(year%100!=0))||(year%400==0)) x=29;
else x=28;
if (month==1) c=day;
else if (month==2) c=31+day;
else if (month==3) c=31+x+day;
else if (month==4) c=31+31+x+day;
else if (month==5) c=31+31+30+x+day;
else if (month==6) c=31+31+30+31+x+day;
else if (month==7) c=31+31+30+31+30+x+day;
else if (month==8) c=31+31+30+31+30+31+x+day;
else if (month==9) c=31+31+30+31+30+31+31+x+day;
else if (month==10) c=31+31+30+31+30+31+31+30+x+day;
else if (month==11) c=31+31+30+31+30+31+31+30+31+x+day;
else if (month==12) c=31+31+30+31+30+31+31+30+31+30+x+day;
num=(c-1)%7+j;
printf("今天是%d年%d月%d日 星期%d 是%d年的第%d天\n",year,month,day,num,year,c);
return 0;
}