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