#include #include using namespace std; int func(unsigned int a, unsigned int b); int main() { array days {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; int answer = 0; for ( unsigned int i = 0; i < days.size(); ++i ) { answer += func((i+1), days.at(i)); } cout << answer << endl; return 0; } int func(unsigned int a, unsigned int b) { int happyDays = 0; for ( unsigned int j = 1; j <= b; ++j) { unsigned int c = ( j / 10) + ( j % 10); if ( a == c ) ++happyDays; } return happyDays; }