Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "complexx.h"
- namespace COMPLEX
- {
- Complex::Complex()
- {
- A = 0;
- Bi = 0;
- }
- Complex::Complex(double value)
- {
- A = Bi = static_cast<int>(value);
- }
- Complex::Complex(double v1, double v2)
- {
- A = static_cast<int>(v1);
- Bi = static_cast<int>(v2);
- }
- std::istream& operator >>(std::istream& in, Complex& c)
- {
- in >> c.A;
- in >> c.Bi;
- return in;
- }
- std::ostream& operator <<(std::ostream& out, Complex& c)
- {
- out << "A: " << c .A << std::endl;
- out << "Bi: " << c.Bi << std::endl;
- return out;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement