/* * rational_prog.cpp * * Created on: 28.02.2013 * Author: trifon */ #include using namespace std; #include "rational.h" int main() { Rational r; // извиква конструктор по подразбиране Rational q = Rational(); Rational s = Rational(3, 5); Rational p(3, 5); r.read(); // нарушаване на абстракцията // p.denom = 0; Rational result = add(r, p); result.print(); /* cout << r.numer << ' ' << r.denom << endl; cout << q.numer << ' ' << q.denom << endl; cout << s.numer << ' ' << s.denom << endl; cout << p.numer << ' ' << p.denom << endl; */ // !!! print(r); r.print(); q.print(); s.print(); p.print(); return 0; }