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(); }
public PS Chia(PS t2) { PS t = new PS(); t.ts = this.ts * t2.ms; t.ms = this.ms * t2.ts; return(t); }
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); }
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); }
public PS(PS t) { this.ts = t.ts; this.ms = t.ms; }