static void Main4() { DaThuc d1 = new DaThuc(); DaThuc d2 = new DaThuc(); Console.WriteLine("Da thuc thu nhat"); d1.Hien(); Console.WriteLine("Da thuc thu hai"); d2.Hien(); DaThuc d3 = d1.Tong(d2); DaThuc d4 = d1.Hieu(d2); Console.WriteLine("Da thuc tong"); d3.Hien(); Console.WriteLine("Da thuc hieu"); d4.Hien(); Console.ReadLine(); }
public DaThuc Hieu(DaThuc t2) { if (this.n == t2.n) { DaThuc d = new DaThuc(this.n); for (int i = 0; i < n; i++) { d.a[i] = this.a[i] - t2.a[i]; } return(d); } else { return(null); } }