Advertisement
Ann1ks

Untitled

Jan 19th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.54 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 ConsoleApp2
  8. {
  9. class PDate
  10. {
  11. private int day;
  12. public int Day
  13. {
  14. get
  15. {
  16. return day;
  17. }
  18. set
  19. {
  20. if (value < 1 || value > 31)
  21. Console.WriteLine("ты пидрила ахуел сука");
  22. else
  23. day = value;
  24. }
  25. }
  26. private int month;
  27. public int Month
  28. {
  29. get
  30. {
  31. return month;
  32. }
  33. set
  34. {
  35. if (value < 1 || value > 12)
  36. Console.WriteLine("ты пидрила ахуел сука бич");
  37. else
  38. month = value;
  39. }
  40. }
  41. public PDate()
  42. {
  43. day = 1;
  44. month = 12;
  45. }
  46.  
  47. public PDate(int day,int month)
  48. {
  49. Day = day;
  50. Month = month;
  51. }
  52.  
  53. public virtual int Nextday()
  54. {
  55. if (Day != 31)
  56. Day++;
  57. else
  58. Console.WriteLine("ты чепушила ебучий глаза разуй ебать ебаный рот");
  59. return Day;
  60. }
  61.  
  62. public static bool operator >(PDate o1,PDate o2)
  63. {
  64. if (o1.month > o2.month)
  65. return true;
  66. else if(o1.month==o2.month)
  67. {
  68. if (o1.day > o2.day)
  69. return true;
  70. else
  71. return false;
  72. }
  73. else
  74. return false;
  75. }
  76. public static bool operator <(PDate o1, PDate o2)
  77. {
  78. if (o1.month < o2.month)
  79. return true;
  80. else if (o1.month == o2.month)
  81. {
  82. if (o1.day < o2.day)
  83. return true;
  84. else
  85. return false;
  86. }
  87. else
  88. return false;
  89. }
  90. //public static bool operator <(PDate o1, PDate o2)
  91. //{
  92. // if (o1.month < o2.month)
  93. // return o1.month < o2.month;
  94. //}
  95.  
  96. }
  97.  
  98. class PMDate : PDate
  99. {
  100. public int Year { get; set; }
  101. public PMDate(int day,int month,int year)
  102. : base(day,month)
  103. {
  104. Year = year;
  105. }
  106.  
  107. public override int Nextday()
  108. {
  109. if (Day < 30)
  110. Day += 2;
  111. else
  112. Console.WriteLine("сука ты еблан чтоли, куда прибавляем? Хуй соси");
  113. return Day;
  114. }
  115. }
  116.  
  117.  
  118. class Program
  119. {
  120. static void Main(string[] args)
  121. {
  122. PDate date1 = new PDate(23, 11);
  123. PDate date2 = new PDate(31, 11);
  124. PDate date3 = new PDate(23, 5);
  125. bool res = date1 > date2;
  126. Console.WriteLine(res);
  127. res = date3 > date1;
  128. Console.WriteLine(res);
  129. Console.WriteLine($"так нахуй погнали {date1.Day} уебали +1 = ебать {date1.Nextday()}");
  130. PMDate date1_1 = new PMDate(5, 11, 2017);
  131. Console.WriteLine($"так нахуй погнали {date1_1.Day} уебали +2 = ебать {date1_1.Nextday()}");
  132. }
  133. }
  134. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement