#include using namespace std; int main(int argc, char **argv) { struct tm t; t.tm_year = 115; t.tm_mon = 0; t.tm_mday = 1; t.tm_hour = 0; t.tm_min = 0; t.tm_sec = 0; int sum = 0; for (int i = 0; i < 365; i++) { time_t mt = mktime(&t); if (t.tm_mon + 1 == (t.tm_mday / 10 + t.tm_mday % 10)) { //printf("month = %d, day = %d\n", t.tm_mon + 1, t.tm_mday); sum++; } t.tm_mday++; } printf("%d\n", sum); return 0; }