#include #include #include #include #include using namespace std; const int SIZE = 13; const int days[SIZE] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; int calc(int n) { return n / 10 + n % 10; } int main() { int happy = 0; for (int i = 1; i < SIZE; i++) { for (int j = 1; j <= days[i]; j++) { if (calc(j) == i) { happy++; // printf("%2d: %02d/%02d\n", happy, i, j); } } } cout << happy << endl; return 0; }