fork download
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. double ma, ba, mb, bb;
  6. scanf("y=%lfx%lf y=%lfx%lf", &ma, &ba, &mb, &bb);
  7. double x = (ba - bb) / (mb - ma);
  8. double y = ma * x + ba;
  9. printf("(%f, %f)\n", x, y);
  10. return 0;
  11. }
Success #stdin #stdout 0s 2300KB
stdin
y=-5x
y=-4x+1
stdout
(0.000000, -0.000000)