using System; public struct complex { public double real; public double imaginary; public complex(double real, double imaginary) { this.real = real; this.imaginary = imaginary; } public static complex operator +(complex c1, complex c2) { return new complex( c1.real + c2.real, c1.imaginary + c2.imaginary); } public static complex operator -(complex c1, complex c2) { return new complex( c1.real - c2.real, c1.imaginary - c2.imaginary); } public override string ToString() { return(String.Format("{0} + {1}i", real, imaginary)); } } class c2502 { public static void Main() { complex c1 = new complex(2,3); complex c2 = new complex(3,4); complex c3 = c1 + c2; complex c4 = c1 - c2; Console.WriteLine(" {0}",c1); Console.WriteLine(" {0}",c2); Console.WriteLine(" {0}",c3); Console.WriteLine(" {0}",c4); } }//