Add tags

Add tags to the following comment

LINQのみ。 もうちょっと書きようがあるかなぁ?

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
DateTime today = DateTime.Now.Date;
var q = from year in Enumerable.Range(today.Year, 2014 - today.Year)
        from month in Enumerable.Range(1, 12)
        let d = new DateTime(year, month, 13)
        where (d.DayOfWeek == DayOfWeek.Friday) && (d >= today)
        select d;
foreach (DateTime d in q)
{
    Console.WriteLine("{0:yyyy/MM/dd(ddd)}", d);
}
Console.WriteLine(q.Count());
}

Add tags

The input will be splited to tags with space.

Index

Feed

Other

Link

Pathtraq

loading...