public class Answer { public static void main(String str[]) { int sum = 0; int maxDate; for(int i=1; i<=12; i++) { switch(i) { case 2: maxDate = 28; break; case 1: case 3: case 5: case 7: case 8: case 10: case 12: maxDate = 31; break; default: maxDate = 30; } for(int j=1; j<=maxDate; j++) { int ten = j/10; int one = j%10; if(i==(ten+one)) { sum++; } } } System.out.println(sum); } }