Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.IO;
- class Exercise
- {
- static void Main(string[] args)
- {
- Console.WriteLine("Enter date: ");
- string dateStr = Console.ReadLine();
- DateTime date;
- bool dateCorrectFormat = DateTime.TryParse(dateStr, out date);
- if (dateCorrectFormat)
- {
- Console.WriteLine(date.);
- }
- else
- {
- Console.WriteLine("Wrong format!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement