class Datetime{
public:
Datetime(int a,int b,int c):year(a),month(b),day(c){}
Datetime(int a):year(int(a/10000)),month(int(a%10000/100)),day(int(a%100)){}
void print(){cout<<year<<" "<<month<<" "<<day<<endl;}
int year_yun();
int day_num();
int week_day();
public:
int year;
int month;
int day;
};
int Datetime::year_yun()
{
int sum=0;
for(int i=1900;i<year;i++)
sum+=(i%4==0&&i%100!=0||i%400==0)?1:0;
return sum;
}
int Datetime::day_num()
{
int temp;
int day_num=0;
int day_num_yun=year_yun()*366;
int day_num_fyun=(year-1900-year_yun())*365;
temp=(year%4==0&&year%100!=0||year%400==0)?1:0;
switch(month){
case 1:day_num=day;break;
case 2:day_num=31+day;break;
case 3:day_num=59+temp+day;break;
case 4:day_num=90+temp+day;break;
case 5:day_num=120+temp+day;break;
case 6:day_num=151+temp+day;break;
case 7:day_num=181+temp+day;break;
case 8:day_num=212+temp+day;break;
case 9:day_num=243+temp+day;break;
case 10:day_num=273+temp+day;break;
case 11:day_num=304+temp+day;break;
case 12:day_num=334+temp+day;break;
}
return day_num_fyun+day_num_yun+day_num;
}
int Datetime::week_day()
{
return day_num()%7?day_num()%7:7;
}
int main()
{
int a,b,c;
while(1){
cin>>a;
if(cin.get()=='\n')
{
Datetime t(a);
cout<<"今天星期:"<<t.week_day()<<endl;
}
else
{
cin>>b>>c;
Datetime t1(a,b,c);
cout<<"今天星期:"<<t1.week_day()<<endl;
}
}
return 0;
}
*/
//根据日期返回星期几