Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Globalization;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _13._1000_Days_After_Birth
- {
- class Program
- {
- static void Main(string[] args)
- {
- // normal solution
- string str = Console.ReadLine();
- DateTime date = DateTime.ParseExact(str, "dd-MM-yyyy", CultureInfo.InvariantCulture);
- date = date.AddDays(999);
- Console.WriteLine(date.ToString("dd-MM-yyyy"));
- // one line solution
- //Console.WriteLine(
- // DateTime.ParseExact(Console.ReadLine(), "dd-MM-yyyy", CultureInfo.InvariantCulture).AddDays(999).ToString("dd-MM-yyyy")
- // );
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement