Beispiel #1
0
            static void Main2()
            {
                PS t1 = new PS();
                PS t2 = new PS();

                Console.WriteLine("Tong 2 phan so");
                PS t3 = t1.Tong(t2);

                t3.Hien();

                Console.WriteLine("Hieu 2 phan so");
                PS t4 = t1.Hieu(t2);

                t4.Hien();

                Console.WriteLine("Tich 2 phan so");
                PS t5 = t1.Tich(t2);

                t5.Hien();

                Console.WriteLine("Thuong 2 phan so");
                PS t6 = t1.Thuong(t2);

                t6.Hien();

                if (t1 > t2)
                {
                    Console.WriteLine("t1 > t2");
                }
                else
                {
                    Console.WriteLine("t1 <= t2");
                }
                Console.ReadKey();
            }
Beispiel #2
0
        public PS Tong(PS t2)
        {
            PS t = new PS();

            t.ts = this.ts * t2.ms + this.ms * t2.ts;
            t.ms = this.ms * t2.ms;
            return(t);
        }
Beispiel #3
0
        public PS Hieu(PS t2)
        {
            PS t = new PS();

            t.ts = this.ts * t2.ms - this.ms * t2.ts;
            t.ms = this.ms * t2.ms;
            return(t);
        }
Beispiel #4
0
 public PS(PS t)
 {
     this.ts = t.ts;
     this.ms = t.ms;
 }