123456789101112131415161718192021 |
- #include <iostream>
- #include "Rational.h"
- using namespace std;
- int main() {
- Rational a, b, c, D, x1, x2;
- a = Rational(1.0 / 1);
- b = Rational(-62.0 / 133);
- c = Rational(-51.0 / 133);
- cout << "sqrt" << endl;
- D = ((b*b) -(Rational)4 * a * c).sqrt();
- x1 = ((-b - D) / ((Rational)2 * a));
- x2 = ((-b + D) / ((Rational)2 * a));
- cout << (double)x1 << endl;
- cout << (double)x2 << endl;
- }
|