//No.188 HAPPY DAY //http://yukicoder.me/problems/492 //20170417 1605 package no188; public class No188 { public static void main(String[] args) { int happyCount; int[] monthMax = new int[]{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; happyCount = 0; for(int i = 1; i <= 12; i++){ for (int j = 1; j <= monthMax[i - 1]; j++) { if (i == j / 10 + j % 10) { happyCount++; } } } System.out.println(happyCount); } }