using System;
using System.Linq;
class Program
{
static void Main()
{
int year = DateTime.Now.Year;
int weekdayCount = CountWeekdaysInYear(year);
Console.WriteLine($"Number of weekdays in {year}: {weekdayCount}");
}
static int CountWeekdaysInYear(int year) {
int weekdayCount = 0;
DateTime startDate = new DateTime(year, 1, 1);
DateTime endDate = new DateTime(year, 12, 31);
return Enumerable.Range(0, (endDate - startDate).Days + 1)
.Select(offset => startDate.AddDays(offset))
.Count(date => date.DayOfWeek != DayOfWeek.Saturday && date.DayOfWeek != DayOfWeek.Sunday);
}
}
/*
run:
Number of weekdays in 2025: 261
*/