Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class NextDate
- {
- static void Main()
- {
- int d = int.Parse(Console.ReadLine());
- int m = int.Parse(Console.ReadLine());
- int y = int.Parse(Console.ReadLine());
- DateTime thisDate1 = new DateTime();
- try
- {
- thisDate1 = new DateTime(y, m, d + 1);
- }
- catch
- {
- try
- {
- thisDate1 = new DateTime(y, m + 1, 1);
- }
- catch
- {
- thisDate1 = new DateTime(y + 1, 1, 1);
- }
- }
- Console.WriteLine(thisDate1.ToString("d.M.yyyy"));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement