public static DaThuc operator -(DaThuc f, DaThuc g) { DaThuc h = new DaThuc(); int maxbac = Math.Max(f.n, h.n); h.n = maxbac; for (int i = 0; i <= h.n; i++) { h.dt[i] = f.dt[i] - g.dt[i]; } return(h); }
static void Main(string[] args) { DaThuc dt1 = new DaThuc(); DaThuc dt2 = new DaThuc(); dt1.Nhap(); dt1.xuat(); dt2.Nhap(); dt2.xuat(); Console.WriteLine("Toan tu +, - "); DaThuc dt3 = new DaThuc(); dt3 = dt1 + dt2; dt3.xuat(); dt3 = dt1 - dt2; dt3.xuat(); }