Skip to content

Instantly share code, notes, and snippets.

@theoremoon
Created February 9, 2015 20:31
Show Gist options
  • Save theoremoon/7545528b8d5624381f51 to your computer and use it in GitHub Desktop.
Save theoremoon/7545528b8d5624381f51 to your computer and use it in GitHub Desktop.
/*
* AOJ 4
* Simultaneous Equation (PCK 2003)
* AC
*/
#include <iostream>
#include <cstdio>
using namespace std;
int main () {
double a, b, c,
d, e, f;
while(cin >> a >> b >> c >> d >> e >> f) {
double y = (c*d-f*a) / (b*d-e*a);
double x = (c - b*y) / a;
printf("%.3lf %.3lf\n", x, y);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment