Advertisement
Guest User

P05._Book_Library

a guest
Feb 20th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.89 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Globalization;
  4. using System.Linq;
  5.  
  6. namespace P05._Book_Library
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             int counter = int.Parse(Console.ReadLine());
  13.             List<string> line = new List<string>();
  14.             var dict = new Dictionary<string, DateTime>();
  15.             for (int i = 0; i < counter; i++)
  16.             {
  17.                 line = Console.ReadLine().Split().ToList();
  18.                 dict.Add(line[0], DateTime.Parse(line[3]));
  19.             }
  20.  
  21.             DateTime fromDate = DateTime.ParseExact(Console.ReadLine(), "dd.MM.yyyy", CultureInfo.InvariantCulture);
  22.  
  23.             foreach (var item in dict.Where(x=>x.Value>fromDate))
  24.             {
  25.                 Console.WriteLine($"{item.Key} -> {item.Value.ToString("dd.MM.yyyy")}");
  26.             }
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement