class HappyDay{ public static void main(String args[]){ int happyday = 0; //ハッピーディの日数 int[] days = {31,28,31,30,31,30,31,31,30,31,30,31}; //各月の日数 for(int i = 0; i < 12; i++){ for(int j = 1; j <= days[i]; j++){ if((i+1) == (j /10) + (j % 10)){ happyday++; }else{} } } System.out.println(happyday); } }