#include #include #include #include #include #include #include #include #include #include #include #include #include #include #define rep(x, to) for (int x = 0; x < (to); x++) #define REP(x, a, to) for (int x = (a); x < (to); x++) #define foreach(itr, x) for (typeof((x).begin()) itr = (x).begin(); itr != (x).end(); itr++) using namespace std; typedef long long ll; typedef pair PII; typedef pair PLL; int days [] = { 31, // 1 28, // 2 31, // 3 30, // 4 31, // 5 30, // 6 31, // 7 31, // 8 30, // 9 31, // 10 30, // 11 31, // 12 }; bool is_leap(int year) { if (year % 400) return true; if (year % 4 == 0 && year != 100) return true; return false; } int check(int m, int d) { return m == d%10 + d/10; } int ans; int main() { int year = 2015; days[2-1] += (int)is_leap(2015); rep(i, 12) { rep(j, days[i]) { int month = i + 1; int day = j + 1; ans += check(month, day); } } cout << ans << endl; return 0; }