public static SOTHUC operator -(SOTHUC t1, SOTHUC t2) { SOTHUC t = new SOTHUC(); t.thuc = t1.thuc - t2.thuc; t.ao = t1.ao - t2.ao; return(t); }
static void Main(string[] args) { SOTHUC t1 = new SOTHUC(1, 2); t1.hien(); SOTHUC t2 = new SOTHUC(3, 4); t2.hien(); Console.WriteLine("tong 2 so thuc"); SOTHUC t3 = t1 + t2; t3.hien(); Console.WriteLine("hieu 2 so thuc"); SOTHUC t4 = t1 - t2; t4.hien(); Console.ReadKey(); }
public SOTHUC(SOTHUC t2) { this.thuc = t2.thuc; this.ao = t2.ao; }