using System; using System.Collections.Generic; using System.Linq; namespace ConsoleApp17 { class Program { static void Main(string[] args) { int happyday = 0; int dd = 0; for (int m=1;m<=12;++m) { for (int d=1;d<=31;++d) { if (m == 2 && 29 <= d) { break; } if ((m == 4 || m == 6 || m == 9 || m == 11) && 31 == d) { break; } if ( 0 <= d && d <= 9) dd = d; if (10 <= d && d <= 19) dd = d - 10 + 1; if (20 <= d && d <= 29) dd = d - 20 + 2; if (30 <= d && d <= 31) dd = d - 30 + 3; if (m == dd) happyday += 1; } dd = 0; } Console.WriteLine(happyday); Console.ReadLine(); } } }