#include <iostream>                // Ex27
#include <cmath>                // needed to use routine sqrt (square root)
using namespace std;
struct complex {
    double re, im;                // real and imaginary Cartesian coordinates
    double abs() { return sqrt( re * re + im * im ); }
};
int main() {
    complex x = { 3.0, 5.2 }, y = { -9.1, 7.4 };
    cout << "x:" << x.re << "+" << x.im << "i" << endl;
    cout << "y:" << y.re << "+" << y.im << "i" << endl;
    cout << "xd:" << x.abs() << endl;
    cout << "yd:" << y.abs() << endl;
}
