public static void Main()
Console.WriteLine("Hello World");
Counter counter = new Counter(5, 0, 10);
Console.WriteLine(counter.Value);
set { val = value; InRange(); }
private int min { get; set;}
private int max { get; set;}
public Counter(int _val, int _min, int _max)
public Counter(int _min, int _max)
Value = new Random().Next(min, max + 1);
public static Counter operator ++(Counter c)
public static Counter operator --(Counter c)
if (val > max || val < min)
throw new ArgumentOutOfRangeException("Значение не в заявленном диапазоне.");