#include #include using namespace std; #include "razlomak.hpp" int main() { Razlomak r(2, 3); //r.postaviBrojilac(1); //r.postaviImenilac(2); //cout << "r = " << r.vratiBrojilac() << "/" << r.vratiImenilac() << endl; cout << "r = " << r << endl; Razlomak x, y; cout << "Unesi x: "; try { cin >> x; } catch (const char *s) { cerr << s << endl; exit(EXIT_FAILURE); } cout << "x = " << x << endl; cout << "Unesi y: "; try { cin >> y; } catch (const char *s) { cerr << s << endl; exit(EXIT_FAILURE); } cout << "y = " << y << endl; //cout << "x + y = " << saberi(x, y) << endl; //cout << "x + y = " << x.saberiSa(y) << endl; cout << "x + y = " << x + y << endl; cout << "x - y = " << x - y << endl; cout << "x * y = " << x * y << endl; cout << "x / y = " << x / y << endl; cout << "Reciprocna vrednost razlomka x je " << ~x << endl; cout << "x + 1 = " << x + 1 << endl; cout << "(double)x = " << (double)x << endl; return 0; }