BorislavBorisov

14.01.Next Date-използва се Date Time

Sep 29th, 2015
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.63 KB | None | 0 0
  1. using System;
  2. /*Метода AddDays() променя само деня към цялата дата, а .Day слага само деня*/
  3. class NextDate
  4. {
  5.     static void Main()
  6.     {
  7.         int day = int.Parse(Console.ReadLine());
  8.         int month = int.Parse(Console.ReadLine());
  9.         int year = int.Parse(Console.ReadLine());
  10.  
  11.         DateTime currentDate = new DateTime(year,month,day);
  12.        
  13.         currentDate = currentDate.AddDays(1);        
  14.         Console.WriteLine(currentDate.Day + "." + currentDate.Month + "." +
  15.             currentDate.Year);//по този начин долепяме датите
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment