コード例 #1
0
        static void Main(string[] args)
        {
            WorkDays w;
            Console.Write("Year:");
            string syear=Console.ReadLine();
            Console.Write("Month:");
            string smonth=Console.ReadLine();
            Console.Write("Day:");
            string sday=Console.ReadLine();

            uint year = 0;
            uint month = 0;
            uint day = 0;
            try
            {
                year = uint.Parse(syear);
                month = uint.Parse(smonth);
                day = uint.Parse(sday);
                w = new WorkDays(new DateTime((int)year, (int)month, (int)day));
                w.GetWorkDays();
            }
            catch (Exception ex)
            {
                Console.WriteLine("Invalid input!");
            }
        }
コード例 #2
0
 private void PrintNumberOfWorkDays(int n,WorkDays w)
 {
     Console.WriteLine("The number of workdays from today till {0} is {1}",w.date,n);
 }