fork download
  1. #include <iostream>
  2. #include <math.h>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. double a1, b1, c1, a2, b2, c2;
  8. cin >> a1 >> b1 >> c1 >> a2 >> b2 >> c2;
  9. double d = a1*b2-a2*b1;
  10. double d1 = c1*b2-c2*b1;
  11. double d2 = a1*c2-a2*c1;
  12. printf("%.3lf\n%.3lf\n", d1/d, d2/d);
  13. return 0;
  14. }
Success #stdin #stdout 0s 4544KB
stdin
5 8 11
-3 6 15
stdout
-1.000
2.000