Ejemplo n.º 1
0
            static void Main(string[] args)
            {
                Phanso t = new Phanso();

                t.nhap(); Console.WriteLine(" ps thu 1"); t.hien();
                Phanso t2 = new Phanso();

                t2.nhap(); Console.WriteLine("ps thu 2"); t2.hien();
                Phanso t3 = t + t2; t3.rutgon(); Console.WriteLine("tong 2 ps"); t3.hien();
                Phanso t4 = t * t2; t4.rutgon(); Console.WriteLine("tich 2 ps"); t4.hien();

                Console.WriteLine("ket qua so sanh");
                if (t > t2)
                {
                    Console.WriteLine("ps t1>ps t2");
                }
                else if (t < t2)
                {
                    Console.WriteLine("ps t1<ps t2");
                }
                else
                {
                    Console.WriteLine("hai ps = nhau");
                }
                Console.ReadKey();
            }