题解:
#include <iostream>
#include <stdio.h>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <string>
#include <cstring>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <ctime>
#include <vector>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define ms(s) memset(s, 0, sizeof(s))
const int inf = 0x3f3f3f3f;
int main()
{
int y = 2000, m = 1,d = 1;
int w = 6;//sataday
int res = 0;
while(y != 2020 || m != 10 || d != 2)
{
if(w == 1 || d == 1) res += 2;
else res++;
d++;
w = (w+1) % 7;
int t;
if(m == 4 || m == 6 || m == 9 || m == 11) t = 30;//1 3 5 7 8 10 12
else if(m != 2) t = 31;//4 6 9 11
else if(y % 4 == 0 && y % 100 || y % 400 == 0) t = 29; //判断2月的 闰年29 平年28
else t = 28;
//更新月份日期
if(d > t) d = 1,m++;
if(m > 12) m = 1,y++;
}
cout << res;
return 0;
}