Go: package main

import (
        "fmt"
        "bufio"
        "os"
        "math"
)

func main() {
        var a, b, c, d, e, f float64
        sc := bufio.NewScanner(os.Stdin)
        for sc.Scan() {
                fmt.Sscanf(sc.Text(), "%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f)

                det := a*e - b*d
                x := (e*c - b*f) / det
                y := (a*f - c*d) / det
                if x == 0.0 {
                        x = math.Abs(x)
                }
                if y == 0.0 {
                        y = math.Abs(y)
                }
                fmt.Printf("%.3f %.3f\n", x, y)
        }
}

C++: #include <bits/stdc++.h>
using namespace std;

const double eps = 1e-10;
typedef vector<vector<double>> mat;

vector<double> gauss_jordan(const mat& A, const vector<double> b) {
	int n = A.size();
	mat B(n, vector<double>(n + 1));
	for(int i = 0; i < n; ++i)
		for(int j = 0; j < n; ++j)
			B[i][j] = A[i][j];
	for(int i = 0; i < n; ++i)
		B[i][n] = b[i];
	
	for(int i = 0; i < n; ++i){
		int pivot = i;
		for(int j = i; j < n; ++j){
			if(abs(B[j][i]) > abs(B[pivot][i]))
				pivot = j;
		}
		swap(B[i], B[pivot]);
		
		if(abs(B[i][i]) < eps)
			return vector<double>();
		
		for(int j = i + 1; j <= n; ++j)
			B[i][j] /= B[i][i];
		for(int j = 0; j < n; ++j){
			if(i != j){
				for(int k = i + 1; k <= n; ++k)
					B[j][k] -= B[j][i] * B[i][k];
			}
		}
	}
	vector<double> x(n);
	
	for(int i = 0; i < n; ++i)
		x[i] = B[i][n];
	return x;
}

int main() {
	double a, b, c, d, e, f;
	while(cin >> a >> b >> c >> d >> e >> f){
		mat m;
		vector<double> l1, l2, r;
		l1.push_back(a); l1.push_back(b); r.push_back(c);
		l2.push_back(d); l2.push_back(e); r.push_back(f);
		m.push_back(l1); m.push_back(l2);
		vector<double> ans = gauss_jordan(m, r);
		printf("%.3f %.3f\n", ans[0], ans[1]);
	}
	return 0;
}

C++: #include<cstdio>
#include<cstdlib>
#include<cmath>
#include<climits>
#include<iostream>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<list>
#include<map>
#include<set>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};
 
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

int main(){
    while(1){
        double a,b,c,d,e,f;
        int ret = scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f);
        if(ret == EOF)
            break;

        double x = (c * e - f * b) / (a * e - d * b);
        double y = (c * d - f * a) / (b * d - e * a);

        printf("%1.3lf %1.3lf\n",x,y);
    }
    return 0;
}

C++: #include <iostream>
using namespace std;
int main() {
    double a, b, c, d, e, f, x, y;
    cout.precision(3);
    cout << fixed;
    while (cin >> a >> b >> c >> d >> e >> f) {
        x = (c * e - b * f) / (a * e - b * d);
        y = (a * f - c * d) / (a * e - b * d);
        if (x == 0) x = 0;
        if (y == 0) y = 0;
        cout << x << " " << y << endl;
    }
    return 0;
}

C++: #include <cstdio>
#include <cmath>
using namespace std;

int main() {
  double a, b, c, d, e, f;
  while (scanf("%lf%lf%lf%lf%lf%lf", &a, &b, &c, &d, &e, &f) != EOF) {
    double det = a * e - b * d;
    double x = (c * e - b * f) / det;
    double y = (a * f - c * d) / det;
    if (fabs(x) < 1e-8) { x = 0; }
    if (fabs(y) < 1e-8) { y = 0; }
    printf("%.3f %.3f\n", x, y);
  }
}

C++: #include<iostream>
#include<sstream>
#include<string>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<map>
#include<vector>
#include<queue>
#include<set>
#include<numeric>

using namespace std ;

#define pb(n) push_back(n)
#define fi first
#define se second
#define np string::npos
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define repc(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto n :(array))

typedef long long ll ;
typedef vector<int> vi ;
typedef vector<ll> vl ;
typedef map<string,int> dict;

constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
double eps = 1e-10 ;

template <typename T>
void out(vector < T > v)
{
  for(size_t i = 0; i < v.size(); i++)
  {
    debug(v[i]);
  }
}

template<typename T>
string ntos( T i ) {
  ostringstream s ;
  s << i ;
  return s.str() ;
}

template<typename T>
T ston(string str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  double a,b,c,d,e,f,x,y;
  while(cin >> a >> b >> c >> d >> e >> f){
    x = (b*f-e*c)/(b*d-e*a) * 10000 ;
    if(x > 0){
      x += 0.5 ;
    }
    else if(x < 0){
      x -= 0.5 ;
    }
    x = (double)((int)(x))/10000.0 ;
    y = (c*d-a*f)/(b*d-e*a) * 10000 ;
    if(y > 0){
      y += 0.5 ;
    }
    else if(y < 0){
      y -= 0.5 ;
    }
    y =(double)((int)(y))/10000 ;
    cout << x << " " << y << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <cstdio>
using namespace std;

int main()
{
	double x, y;
	double a, b, c, d, e, f;
	
	while(scanf("%lf", &a) != EOF)
	{
		cin >> b >> c >> d >> e >> f;
		
	x = (c * e - b * f) / (a * e - b * d);
	y = (a * f - c * d) / (a * e - b * d);
	
	cout << setprecision(3);
	cout << setiosflags(ios::fixed);

	cout << x << " " << y << endl;
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

int main( void ) {
    double a, b, c, d, e, f;
    while(cin >> a >> b >> c >> d >> e >> f) {
        double y = ((c*d - a*f) / (b*d - a*e));
        double x = ((c*e - f*b) / (a*e - b*d));
        printf("%.3lf, %.3lf\n", x, y);
    }
    return 0;
}

C++: 
using namespace std;
#define j bai;
int main() {
	double a, b, c, d, e, y, x, f, bai;
	bool bo = false;
	while (cin >> a >> b >> c >> d >> e >> f) {
		if (a ==0 || b ==0) {
			if (a) {
				y = c / b;
				x = f / d - e*y;
			}
			else if (b) {
				x = a / c;
				y = f / e - d*x;
			}
			bo = true;
		}
		else if (d == 0 || e == 0) {
			if (d) {
				y = f / e;
				x = c / a - d*y;
			}
			else if (e) {
				x = f / d;
				y = f / e - d*x;
			}
			bo = true;
		}
		
		else if (a < d) {
			bai = d / a;
			a *= j;
			b *= j;
			c *= j;
		}
		else {
			bai = a / d;
			d *= j;
			e *= j;
			f *= j;
		}
		if (((a > 0 && d < 0) || (a < 0 && d>0)) && bo==false) {
			y = (c + f) / (b + e);
			x = (c - b*y) / a;
		}
		else if (bo == false) {
			y = (c - f) / (b - e);
			x = (c - b*y) / a;
		}
		if (x == -0.000) {
			x = abs(x);
		}
		if (y == -0.000) {
			y = abs(y);
		}
		printf("%.3lf %.3lf\n", x, y);
	}
	return 0;
}

C++: #include <cstdio>
#include <cmath>

int main(void)
{
	double a, b, c, d, e, f;

	while (scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF){
		double y = (d * c - a * f) / (d * b - a * e);
		double x = (f - e * y) / d;
		if (fabs(x) > 1e-4) x = 0.0;
		printf("%.3f %.3f\n", x, y);
	}

	return 0;
}

C++: #include <iostream>
using namespace std;

int main()
{
	double a[6], x, y;

	while(cin>>a[0]){
		for(int i = 1; i < 6; i++){
			cin>>a[i];
		}
		y = (a[2]*a[3]-a[0]*a[5])/(a[1]*a[3]-a[0]*a[4]);
		x = (a[2]-a[1]*y)/a[0];

		x = ((double)((int)(x*1000+0.5)))/1000;
		y = ((double)((int)(y*1000+0.5)))/1000;

		printf("%.03f %.03f", x, y);
	}
}