Esempio n. 1
0
            public phanso chia(phanso a)
            {
                phanso b = new phanso();

                b.ts = ts * a.ms;
                b.ms = ms * a.ts;
                return(b);
            }
Esempio n. 2
0
        static void Main(string[] args)
        {
            phanso a = new phanso();

            a.nhap();
            a.show();
            phanso b = new phanso(a);

            b.show();
            Console.ReadLine();
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            phanso a = new phanso();

            a.nhap();
            a.xuat();
            phanso b = new phanso();

            b.nhap();
            b.xuat();
            phanso c = new phanso();

            c = a.cong(b);
            Console.WriteLine($"tong 2 phan so la :{c.ts}/{c.ms} ");
            c = a.tru(b);
            Console.WriteLine($"hieu 2 phan so la :{c.ts}/{c.ms} ");
            c = a.nhan(b);
            Console.WriteLine($"tich 2 phan so la :{c.ts}/{c.ms} ");
            c = a.chia(b);
            Console.WriteLine($"thuong 2 phan so la :{c.ts}/{c.ms} ");

            Console.ReadLine();
        }
Esempio n. 4
0
 public phanso(phanso a)
 {
     ts = a.ts;
     ms = a.ms;
 }