using System; class Program { static void Main(string[] args) { //月と日数の配列の定義 int[] month = new int[12] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }; int[] day = new int[12] { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; //HappyDayの数 int happyDays = 0; //判定 for (int m = 0; m < month.Length; m++) { for (int d = 0; d < day.Length; d++) { if (month[m] == day[d] / 10 + day[d] % 10) { happyDays++; } } } //出力 Console.WriteLine(happyDays); } }