Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace ConsoleApp1
- {
- using System;
- using System.Globalization;
- class Program
- {
- static void Main(string[] args)
- {
- string format = "dd-MM-yyyy";
- int counter1 = 0;
- int counter2 = 0;
- //we read the input here
- int n = int.Parse(Console.ReadLine());
- DateTime date1=DateTime.ParseExact(Console.ReadLine(),format,CultureInfo.InvariantCulture);
- DateTime date2 = DateTime.ParseExact(Console.ReadLine(), format, CultureInfo.InvariantCulture);
- for (int i = 1; i <= n; i++)
- {
- if (i % 2 == 0)
- {
- counter1++;
- }
- else
- {
- counter2++;
- }
- }
- int one = date1.AddDays(counter1).Day;
- int two = date2.AddDays(counter2).Day;
- Console.WriteLine(one+two);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement