Guest User

Untitled

a guest
Jul 10th, 2018
110
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Globalization;
  3. class Program
  4. {
  5.     public static void Main()
  6.     {
  7.         int n = int.Parse(Console.ReadLine());
  8.         DateTime firstDate = DateTime
  9.             .ParseExact(Console.ReadLine(), "dd-MM-yyyy", CultureInfo.InvariantCulture)
  10.             .AddDays(n / 2 + n % 2);
  11.         DateTime secondDate = DateTime
  12.             .ParseExact(Console.ReadLine(), "dd-MM-yyyy", CultureInfo.InvariantCulture)
  13.             .AddDays(n / 2);
  14.         Console.WriteLine(firstDate.Day + secondDate.Day);
  15.     }
  16. }
RAW Paste Data