Example #1
0
        static void Main(string[] args)
        {
            Console.Write("nhap so hang cua ma tran 1 ");
            int soHangMT1 = int.Parse(Console.ReadLine());

            Console.Write("nhap so cot cua  ma tra 1 ");
            int soCotMT1 = int.Parse(Console.ReadLine());
            var a        = new MaTrix1(soHangMT1, soCotMT1);

            a.Nhap();
            Console.Write("nhap so hang cua ma tran 2 ");
            int soHangMT2 = int.Parse(Console.ReadLine());

            Console.Write("nhap so cot cua  ma tra 1 ");
            int soCotMt2 = int.Parse(Console.ReadLine());
            var b        = new MaTrix1(soHangMT2, soCotMt2);

            b.Nhap();
            if (soCotMT1 != soCotMt2 || soHangMT1 != soHangMT2)
            {
                throw new Exception("loi");
            }

            var x = a.Add(b);
            var y = a.Tru(b);

            x.Xuat();

            Console.ReadKey();
        }