Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Dathuc a = new Dathuc();
            Dathuc b = new Dathuc();
            Dathuc c = new Dathuc();


            a.Nhap();
            a.XuatDaThuc();

            Console.WriteLine("---------------------------------");
            b.Nhap();
            b.XuatDaThuc();
            Console.WriteLine("---------------------------------");
            Console.WriteLine("Cong hai da thuc :");
            c.CongDaThuc(a, b).XuatDaThuc();
            //c = a + b;
            //c.XuatDaThuc();
            Console.WriteLine("---------------------------------");
            Console.WriteLine("Tru hai da thuc :");
            c.TruDaThuc(a, b).XuatDaThuc();
            b.XuatDaThuc();
            //c = a - b;
            //c.XuatDaThuc();
            Console.WriteLine("---------------------------------");
            Console.WriteLine("Dao ham da thuc 1 :");
            a.DaoHam().XuatDaThuc();
            Console.ReadLine();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Dathuc T1 = new Dathuc();

            T1.NhapDaThuc();
            T1.XuatDaThuc();

            Dathuc T2 = new Dathuc();

            T2.NhapDaThuc();
            T2.XuatDaThuc();

            Console.WriteLine("T1 + T2 = ");
            Dathuc Tong = T1 + T2;

            Tong.XuatDaThuc();

            Console.WriteLine("T1 - T2 = ");
            Dathuc Hieu = T1 - T2;

            Hieu.XuatDaThuc();

            Console.ReadLine();
        }