                                                            221

          q (.
 7.2,    ,  . 193).

5.        rational. ,
       ,   
,      ,      
(.  7.2,    ,  . 193).

6.  ,    v   .  ,
     matrix  vect:

friend vect add(const vect& v, matrix& m) ;

 v        m (. -
 7.3,  ,  . 195).

7.   complex 

class complex {
public:

complex (double r) { real = r; imag =0; }
void assign(double r, double i)

{ real = r; imag = i; }
void print()

{ cout  real  " + "  imag  "i "; }
operator double()

{ return (sqrt(real * real + imag * imag));}
private:

double real, imag;

};

    ,   . ,
- print ()  ,   
operator ():

ostream& operator(ostream& out, complex x)
{

out  x.real  " + "  x.imag  "i ";

return out ;

       .   -
 complex,        .

i.   complex   - , -
  .      complex. -
    .     -
?

I.    :

friend complex operator+(complex, double);

friend complex operator+(double, complex);