#include using namespace std; int main() { struct tm t = {}; t.tm_year = 2015; t.tm_mon = 1 - 1; t.tm_mday = 1; int ans = 0; for (int i = 0; i < 365; i++) { int d = t.tm_mday; if (t.tm_mon + 1 == d / 10 + d % 10) ans++; t.tm_mday++; mktime(&t); } cout << ans << "\n"; }