コード例 #1
0
    static void Main(string[] args)
    {
        Console.Title = "Workdays to given date";

        Console.ForegroundColor = ConsoleColor.Green;

        Console.Write("Enter the month: ");
        int month = int.Parse(Console.ReadLine());

        Console.Write("Enter the day: ");
        int day = int.Parse(Console.ReadLine());

        Workdays workdays = new Workdays(new DateTime(DateTime.Now.Year, month, day));

        Console.ForegroundColor = ConsoleColor.Yellow;
        Console.WriteLine("\nYou have {0} workdays to {1}.{2}.{3}", workdays.CountWorkdays(), day, month, DateTime.Now.Year);

        Console.WriteLine();
        Console.ResetColor();
    }
コード例 #2
0
    static void Main(string[] args)
    {
        Console.Title = "Workdays to given date";

        Console.ForegroundColor = ConsoleColor.Green;

        Console.Write("Enter the month: ");
        int month = int.Parse(Console.ReadLine());

        Console.Write("Enter the day: ");
        int day = int.Parse(Console.ReadLine());

        Workdays workdays = new Workdays( new DateTime(DateTime.Now.Year, month, day));

        Console.ForegroundColor = ConsoleColor.Yellow;
        Console.WriteLine("\nYou have {0} workdays to {1}.{2}.{3}", workdays.CountWorkdays(), day, month, DateTime.Now.Year);

        Console.WriteLine();
        Console.ResetColor();
    }