main_rational.cpp 434 B

1234567891011121314151617181920212223
  1. #include <iostream>
  2. #include "Rational.h"
  3. using namespace std;
  4. int main() {
  5. Rational a, b, c, D, x1, x2;
  6. cout << "smth" << endl;
  7. a = Rational(1.0 / 1);
  8. b = Rational(-62.0 / 133);
  9. c = Rational(-51.0 / 133);
  10. cout << "sqrt" << endl;
  11. D = ((b*b) - a * 4 * c).sqrt();
  12. cout << "there is problem?" << endl;
  13. x1 = ((-b - D) / (a * 2));
  14. x2 = ((-b + D) / (a * 2));
  15. cout << (double)x1 << endl;
  16. cout << (double)x2 << endl;
  17. }