using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Ulugbekovna_Lobar
{
class Counter
{
public int Value { get; set; }
public static bool operator >(Counter c1, Counter c2)
{
return c1.Value > c2.Value;
}
public static bool operator <(Counter c1, Counter c2)
{
return c1.Value < c2.Value;
}
}
class Program
{
static void Main(string[] args)
{
Counter c1 = new Counter { Value = 23 };
Counter c2 = new Counter { Value = 45 };
bool result = c1 > c2;
Console.WriteLine(result);
bool result = c1 < c2;
Console.WriteLine(result1);
Console.ReadKey();
}
}
}
Thread using System;
7 messages · –K . . using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Ulugbekovna_Lobar { class Counter { public int Value { get; set; } public static bool operator >(Counter c1, Counter c2) { return c1.Value > c2.Value; } public static bool operator <(Counter c1, Counter c2) { return c1.Value < c2.Value; } } class Program { static void Main(string[] args) { Counter c1 = new Counter { Value = 23 }; Counter c2 = new Counter { Value = 45 }; bool result = c1 > c2; Console.WriteLine(result); bool result1 = c1 < c2; Console.WriteLine(result1); Console.ReadKey(); } } }K . K