Created
May 19, 2016 08:07
-
-
Save Nikola-Andreev/e2b7c42246360ad9dde76d0aa73d9d71 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Numerics; | |
using System.Globalization; | |
namespace Praktice | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var startDate = DateTime.ParseExact(Console.ReadLine(), | |
"d.M.yyyy", CultureInfo.InvariantCulture); | |
var endDate = DateTime.ParseExact(Console.ReadLine(), | |
"d.M.yyyy", CultureInfo.InvariantCulture); | |
var holidaysCount = 0; | |
for (var date = startDate; date <= endDate; date=date.AddDays(1)) | |
if (date.DayOfWeek == DayOfWeek.Saturday || | |
date.DayOfWeek == DayOfWeek.Sunday) holidaysCount++; | |
Console.WriteLine(holidaysCount); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment