Advertisement
Radostta

1000DaysAfterBirth

Aug 1st, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.65 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _1000_Days_After_Birth
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.          
  14.             string dateString = Console.ReadLine();
  15.             string format = "dd-MM-yyyy";
  16.             DateTime result = DateTime.ParseExact(dateString, format, CultureInfo.InvariantCulture);
  17.             CultureInfo provider = CultureInfo.InvariantCulture;
  18.             DateTime output = Convert.ToDateTime(result).AddDays(999);
  19.             Console.WriteLine(output.ToString("dd-MM-yyyy"));
  20.  
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement