static void Deser() { FileStream fs = new FileStream("ComplexNumber.txt", FileMode.Open, FileAccess.Read); XmlSerializer xs = new XmlSerializer(typeof(ComplexNumber)); ComplexNumber t = xs.Deserialize(fs) as ComplexNumber; t.output(); fs.Close(); }
static void Main(string[] args) { ComplexNumber A = new ComplexNumber { a = 8, b = 4 }; ComplexNumber B = new ComplexNumber { a = 5, b = 3 }; ComplexNumber C = (A - B) * B; C.output(); Deser(); Ser(C); }
static void Main(string[] args) { int x = Convert.ToInt32(Console.ReadLine()); int y = Convert.ToInt32(Console.ReadLine()); ComplexNumber A = new ComplexNumber { a = x, b = y }; x = Convert.ToInt32(Console.ReadLine()); y = Convert.ToInt32(Console.ReadLine()); ComplexNumber B = new ComplexNumber { a = x, b = y }; ComplexNumber C = A + B; C.output(); Ser(C); //Deser(); }