Srxon05

komplex.hpp ispravan

Nov 15th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.15 KB | None | 0 0
  1. #ifndef KOMPLEX_HPP_INCLUDED
  2. #define KOMPLEX_HPP_INCLUDED
  3.  
  4.  
  5.  
  6. #include <iostream>
  7. using namespace std;
  8.  
  9. class Complex
  10. {
  11. private:
  12.     double real;
  13.     double imag;
  14. public:
  15.     Complex();
  16.     Complex(double,double);
  17.     Complex(const Complex&);
  18.     double getReal() const;
  19.     double getImag() const;
  20.     void setReal(double);
  21.     void setImag(double);
  22.     Complex& operator=(const Complex&);
  23.     Complex& operator+=(const Complex&);
  24.     Complex& operator-=(const Complex&);
  25.     Complex& operator*=(const Complex&);
  26.     Complex& operator/=(const Complex&);
  27.     const Complex& operator++();
  28.     const Complex operator++(int);
  29.     friend Complex operator+(const Complex&, const Complex&);
  30.     friend Complex operator-(const Complex&, const Complex&);
  31.     friend Complex operator*(const Complex&, const Complex&);
  32.     friend Complex operator/(const Complex&, const Complex&);
  33.  
  34.     friend bool operator==(const Complex&, const Complex&);
  35.     friend bool operator!=(const Complex&, const Complex&);
  36.     friend ostream& operator<<(ostream&, const Complex&);
  37.     friend istream& operator>>(istream&, Complex&);
  38. };
  39.  
  40.  
  41. #endif // KOMPLEX_HPP_INCLUDED
Advertisement
Add Comment
Please, Sign In to add comment