示例#1
0
文件: Operator.cs 项目: kenenalmat/PT
        static void Main(string[] args)
        {
            complex c = new complex(5, 4);
            complex d = new complex(11, 5);
            complex w = c + d;
            complex f = c - d;
            complex k = c * d;

            Console.WriteLine(w);
            Console.WriteLine(f);
            Console.WriteLine(k);
            Console.ReadKey();
        }
示例#2
0
文件: Operator.cs 项目: kenenalmat/PT
        public static complex operator *(complex c1, complex c2)
        {
            complex c3 = new complex(c1.a * c2.a, c1.b * c2.b);

            return(c3);
        }