#include using namespace std; int calc_happy_day(vector months, int num){ int x = 0, y = 0; int sum = 0; for(int i = 1; i <= 12; i++){ x = i; for(int j = 0; j < months.size(); j++){ if(i == months.at(j)){ for(int k = 1; k <= num; k++){ y = (k % 100) + (k % 10); if(x == y) sum++; } } } } return sum; } int main() { vector a = {1,3,5,7,8,10,12}; vector b = {2}; vector c = {4,6,9,11}; int x = 0, y = 0; int sum = 0; sum += calc_happy_day(a,31); sum += calc_happy_day(b,28); sum += calc_happy_day(c,30); cout << sum << endl; return 0; }