Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
- namespace ConsoleApplication2
- {
- internal class Program
- {
- public static void Main(string[] args)
- {
- var dateTime = new DateTime();
- var dateTimes = new List<DateTime>();
- dateTimes.Add(Convert.ToDateTime("2019-05-05"));
- dateTimes.Add(Convert.ToDateTime("2018-01-05"));
- dateTimes.Add(Convert.ToDateTime("2020-02-21"));
- var SredniRok = dateTimes.Select(x => x.Year).Average();
- var IloscPiatkow = dateTimes.Count(x => x.DayOfWeek == DayOfWeek.Friday);
- Console.WriteLine("sredni rok to : " + SredniRok);
- Console.WriteLine("ilosc piatkow to : " + IloscPiatkow);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement