Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Plural output = new Plural();

            Console.WriteLine("\t请输入第一个实部");
            Console.WriteLine("\ta");
            output.a = (double)Convert.ToDouble(Console.ReadLine());
            Console.WriteLine("\t请输入第一个虚部");
            Console.WriteLine("\tb:");
            output.b = (double)Convert.ToDouble(Console.ReadLine());
            Console.WriteLine("\t请输入第二个实部");
            Console.WriteLine("\tc");
            output.c = (double)Convert.ToDouble(Console.ReadLine());
            Console.WriteLine("\t请输入第二个虚部");
            Console.WriteLine("\td:");
            output.d = (double)Convert.ToDouble(Console.ReadLine());
            Console.WriteLine("\t两个复数相加计算结果为:{0}+{1}i", output.Real_plus(), output.Virtual_plus());
            Console.WriteLine("\t两个复数相减计算结果为:{0}+{1}i", output.Real_subtrict(), output.Virtual_subtract());
            Console.WriteLine("\t两个复数相乘计算结果为:{0}+{1}i", output.Real_multply(), output.Virtual_multply());
            Console.WriteLine("\t两个复数相除计算结果为:{0}+{1}i", output.Real_divide(), output.Virtual_divide());
            Console.Read();
        }