using System; class Program { static void Main() { int Answer = 0; DateTime CurrDay = new DateTime(2015, 1, 1); for (; CurrDay.Year == 2015; CurrDay = CurrDay.AddDays(1)) { if (IsHappyDay(CurrDay)) { Console.WriteLine("{0}はHappy Day", CurrDay.ToString(@"yyyy\/MM\/dd")); Answer++; } } Console.WriteLine(Answer); } static bool IsHappyDay(DateTime pTarget) { int wkMonth = pTarget.Month; int wkDay = pTarget.Day; return wkMonth == wkDay / 10 + wkDay % 10; } }