#include<iostream>
#include<graphics.h>
using namespace std;
void DayPass(SYSTEMTIME &t)
{
if(t.wDayOfWeek==7)
t.wDayOfWeek=1;
else
t.wDayOfWeek++;
switch(t.wDay)
{
case 30:
switch(t.wMonth)
{
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:
t.wDay++;break;
case 4:
case 6:
case 9:
case 11:
t.wDay=1;t.wMonth++;break;
}
break;
case 31:
switch(t.wMonth)
{
case 12:
t.wYear++;t.wMonth=1;t.wDay=1;break;
default:
t.wMonth++;t.wDay=1;break;
}
break;
case 28:
switch(t.wMonth)
{
case 2:
if(t.wYear%4!=0)//common year
{
t.wDay=1;t.wMonth=3;
}
else
t.wDay=29;
break;
default:
t.wDay=29;break;
}
break;
case 29:
if(t.wMonth==2)
{
t.wDay=1;t.wMonth=3;
}
else
t.wDay=30;
break;
default:
t.wDay++;
}
}
int main()
{
SYSTEMTIME time;
time.wYear=1990;time.wMonth=1;time.wDay=1;time.wDayOfWeek=1;
while(time.wYear!=1990||time.wMonth!=7||time.wDay!=1)
DayPass(time);
cout<<time.wYear<<'/'<<time.wMonth<<'/'<<time.wDay<<"星期"<<time.wDayOfWeek<<endl;
//算出是星期日
return 0;
}