Пример #1
0
            static void Main(string[] args)
            {
                PS t = new PS();

                t.Nhap(); t.hien();
                PS t2 = new PS();

                t2.Nhap(); t2.hien();
                PS t3 = t + t2; t3.hien();
                PS t4 = t * t2; t4.hien();

                if (t > t2)
                {
                    Console.WriteLine("ps t1>t2");
                }
                else if (t < t2)
                {
                    Console.WriteLine("ps t1<t2S");
                }
                else
                {
                    Console.WriteLine("hai ps = nhau");
                }
                Console.ReadKey();
            }
Пример #2
0
        public PS Chia(PS t2)
        {
            PS t = new PS();

            t.ts = this.ts * t2.ms;
            t.ms = this.ms * t2.ts;
            return(t);
        }
Пример #3
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);
        }
Пример #4
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);
        }
Пример #5
0
 public PS(PS t)
 {
     this.ts = t.ts;
     this.ms = t.ms;
 }