Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Task03
- {
- class Program
- {
- static void Main(string[] args)
- {
- String EGN = Console.ReadLine();
- int year = int.Parse(EGN.Substring(0, 2));
- int month = int.Parse(EGN.Substring(2, 2));
- int day = int.Parse(EGN.Substring(4, 2));
- if (month > 20 && month <= 32)
- {
- year += 1800;
- month = month - 20;
- }
- else if (month > 40 && month <= 52)
- {
- year += 2000;
- month = month - 40;
- }
- else
- {
- year += 1900;
- }
- DateTime date = new DateTime(year, month, day);
- if (day < 10)
- {
- Console.Write($"0" + day + ".");
- }
- else
- {
- Console.Write(day + ".");
- }
- if (month < 10)
- {
- Console.Write($"0" + month + ".");
- }
- else
- {
- Console.Write(month + ".");
- }
- Console.WriteLine(year);
- Console.WriteLine(date.DayOfWeek);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement