main_rational.cpp 337 B

12345678910111213141516171819
  1. #include <iostream>
  2. #include "Rational.h"
  3. using namespace std;
  4. int main() {
  5. Rational r(19,20);
  6. cout << r << endl;
  7. Rational r2(3, 727);
  8. r += r2;
  9. cout << r << endl;
  10. float x = 1.375;
  11. cout << x << endl;
  12. cout << Rational(x) << endl;
  13. double x2 = 1.375;
  14. cout << x2 << endl;
  15. cout << Rational(x2);
  16. }