Created
January 3, 2012 13:35
-
-
Save hhc0null/1554900 to your computer and use it in GitHub Desktop.
aoj-0004-Simultaneous_Equation-ans.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <iomanip> | |
using namespace std; | |
int main(void) { | |
double a, b, c, d, e, f, x, y, tmp; | |
for(;scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) == 6;) { | |
tmp = a * e - b * d; | |
x = (c * e - b * f) / tmp + 0.0; | |
y = (a * f - c * d) / tmp + 0.0; | |
printf("%.3lf %.3lf\n", x, y); | |
} | |
return 0; | |
} | |
// i am a stupid. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment