public void tinhtong() { Matran a = ds[0]; for (int i = 1; i < s; i++) { a = ds[0].tong(ds[i]); a.hien(); } }
public void nhap() { Console.WriteLine("nhap so luong ma tran"); s = int.Parse(Console.ReadLine()); ds = new Matran[s]; for (int i = 0; i < s; i++) { ds[i] = new Matran(); ds[i].nhap(); } }
public Matran hieu(Matran t2) { Matran t = new Matran(); for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { t.a[i, j] = this.a[i, j] - t2.a[i, j]; } } return(t); }
public Matran tong(Matran t2) { Matran t = new Matran(n); for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { t.a[i, j] = this.a[i, j] + t2.a[i, j]; } } return(t); }