Пример #1
0
        private static void PhuongTrinhBac1()
        {
            double a, b;

            Console.WriteLine("Nhap a");
            double.TryParse(Console.ReadLine(), out a);
            Console.WriteLine("Nhap b");
            double.TryParse(Console.ReadLine(), out b);
            PhuongTrinh pt = new PhuongTrinh();
            double      kq = pt.PhuongTrinhBac1(a, b);

            Console.WriteLine("Ket Qua La:{0}", kq);
        }
Пример #2
0
        private static void TinhTong()
        {
            int a, b;

            Console.WriteLine("Nhap a");
            int.TryParse(Console.ReadLine(), out a);
            Console.WriteLine("Nhap b");
            int.TryParse(Console.ReadLine(), out b);

            PhuongTrinh pt = new PhuongTrinh();
            int         kq = pt.Tong(a, b);

            Console
            .WriteLine("Tong {0} + {1} = {2}", a, b, kq);
        }
Пример #3
0
        private static void PhuongTrinhBac2()
        {
            double a, b, c;

            Console.WriteLine("Nhap a");
            double.TryParse(Console.ReadLine(), out a);
            Console.WriteLine("Nhap b");
            double.TryParse(Console.ReadLine(), out b);
            Console.WriteLine("Nhap c");
            double.TryParse(Console.ReadLine(), out c);
            PhuongTrinh pt = new PhuongTrinh();

            double[] kq = pt.PhuongTrinhBac2(a, b, c);
            Console.WriteLine("Kq x1={0}, x2={1}", kq[0], kq[1]);
        }
Пример #4
0
        static void Main(string[] args)
        {
            //XinChao();
            //XinChao("Nguyen Van Teo");
            try
            {
                PhuongTrinh pt = new PhuongTrinh();
                pt.TimSoLonNhat(2, 4, 8);

                Menu();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }