AlexJC

Date after 5 Days

Aug 27th, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 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 Date_after_5_Days
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. var day = Console.ReadLine();
  14. var month = Console.ReadLine();
  15. string year = "2015";
  16.  
  17. string time = year + '-' + month + '-' + day;
  18.  
  19. DateTime timeNew = DateTime.Parse(time);
  20.  
  21. DateTime after5days = timeNew.AddDays(5);
  22. int dayDate = after5days.Day;
  23. int monthDate = after5days.Month;
  24.  
  25. Console.WriteLine("{0}.{1:00}", dayDate, monthDate);
  26. }
  27. }
  28. }
Add Comment
Please, Sign In to add comment