Advertisement
Guest User

Untitled

a guest
Jan 28th, 2020
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.02 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 ConsoleApp1
  8. {
  9.     enum mname{
  10.        Январь = 1, Февраль,Март,Апрель,Май,Июнь,Июль,Август,Сентябрь,Октябрь,Ноябрь,Декабрь
  11.     };
  12.     struct TDate
  13.     {
  14.         public int Year;
  15.         public byte Month;
  16.         public byte Day;
  17.         public byte Hour;
  18.         public byte Minute;
  19.         public mname MonthName;
  20.     }
  21.    
  22.     class Program
  23.     {
  24.         static TDate TDateInput()
  25.         {
  26.             TDate temp;
  27.             Console.Write("Введите номер года:");
  28.             temp.Year = int.Parse(Console.ReadLine());
  29.             temp.Month = 0;
  30.             temp.Day = 34;
  31.             temp.Hour = 25;
  32.             temp.Minute = 60;
  33.             while (temp.Month < 1 || temp.Month > 12)
  34.             {
  35.                 Console.Write("Введите номер месяца:");
  36.                 temp.Month = Byte.Parse(Console.ReadLine());
  37.             }
  38.             while (temp.Day > 31)
  39.             {
  40.                 Console.Write("Введите день:");
  41.                 temp.Day = Byte.Parse(Console.ReadLine());
  42.             }
  43.             while (temp.Hour > 24)
  44.             {
  45.                 Console.Write("Введите час");
  46.                 temp.Hour = Byte.Parse(Console.ReadLine());
  47.             }
  48.             while (temp.Minute > 59)
  49.             {
  50.                 Console.Write("Введите минуту:");
  51.                 temp.Minute = Byte.Parse(Console.ReadLine());
  52.             }
  53.             temp.MonthName = (mname)temp.Month;
  54.             return temp;
  55.  
  56.         }
  57.         static bool expired(TDate note)
  58.         {
  59.             var note_time = new DateTime(note.Year,note.)
  60.         }
  61.         static void Main(string[] args)
  62.         {
  63.             TDate noviy = TDateInput();
  64.             Console.WriteLine(noviy.MonthName);
  65.             Console.Read();
  66.         }
  67.     }
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement