#include<stdio.h>
#include<stdlib.h>
#include<iostream>
using namespace std;
int mon[13] = { 0,31,28,31,30,31,30,31,31,30,31,30,31 };
int Isyeap(int a)
{
if (a % 4 != 0) return 0;
else if ((a % 100 == 0 ) && (a % 400 != 0)) return 0;
else return 1;
}
int main()
{
int t, a, b, c, m, sum = 0;
cin >> t;
c = t % 100;
t = t / 100;
b = t % 100;
t = t / 100;
a = t;
if (a >= 2000)
{
for (int i = 0; i < a - 2000; i++) {
m = Isyeap(2000+i);
sum = sum + 365 + m;
}
m = Isyeap(a);
for (int j = 0; j < b; j++)
{
sum = sum + mon[j];
}
sum += (b > 2) ? c + m - 1 : c - 1;
}//if
t = (sum-2) % 7;
cout << t+1 <<" "<< sum << endl;
system("pause");
}
任给一个日期,求相差多久并求周几