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 <iostream>
#include <vector>
using namespace std;

int main()
{
	double a,b,c,d,e,f;
	double x,y;
	int count = 0;
	vector<double> result_x,result_y;

	while(cin >> a >> b >> c >> d >> e >> f) {
		y = (a * f - c * d) / (a * e - b * d);
		x = (c - b * y) / a;
		result_y.push_back(y);
		result_x.push_back(x);
		cout << result_x[count] << ' ' << result_y[count] << endl;
		count++;
	}

	return 0;
}

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

int main(){
double a,b,c,d,e,f,a_,b_,c_,d_,e_,f_;
double x,y;
double in;
while (std::cin >>a>>b>>c>>d>>e>>f){
in = (a*e - b*d);
a_ = a/in;
b_ = -1*d/in;
d = -1*b/in;
e_ = e/in;
x = c * a_ + f*b_;
y = c*d_ + f*e_;
std::cout << std::setprecision(3) << x << ' ' << std::setprecision(3) << y << std::endl;
}
    return 0;
}

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

using namespace std;

double EPS = 1e-4;

int gcd(int a, int b) { return b != 0 ? gcd(b, a%b) : a; }

int main() {
	double a, b, c, d, e, f;
	
	while (cin >> a >> b >> c >> d >> e >> f) {
		double x, y;
		
		int div1 = gcd(a, b), div2 = gcd(b, d);
		int div = gcd(div1, div2);
		a /= div; b /= div; c /= div;
		
		div1 = gcd(d, e); div2 = gcd(e, f);
		div = gcd(div1, div2);
		d /= div; e /= div; f /= div;
		
		double s = a*f/d, s_ = a*e/d;
		if (fabs(s) < EPS) s = 0.0;
		if (fabs(s_) < EPS) s_ = 0.0;
		
		y = (c - s)/(b - s_);
		if (fabs(y) < EPS) y = 0.0;
		
		x = (c - b*y)/a;
		if (fabs(x) < EPS) x = 0.0;
		
		printf("%.3lf %.3lf\n", x, y);
	}
	
	return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <sstream>
#include <stdio.h>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <math.h>
#include <utility>
#include <string>
#include <ctype.h>
#include <cstring>
#include <cstdio>
#include <sstream>
using namespace std;

#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define INF 114514810
#define ll long long

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

C++: #include <iostream>
#include <stdio.h>
using namespace std;
int main(){
	double a, b, c, d, e, f;
	double x, y;
	double g, h, i;

	while(cin >> a >> b >> c >> d >> e >> f){

		g = a * d;
		h = g / a;
		i = g / d;

		y = (h * c - i * f) / (h * b - i * e);

		x = ((h * c) - (h * b * y)) / (h * a);

		if(x == 0){
			x = 0;
		}
		else if(y == 0){
			y = 0;
		}

		printf("%.3lf %.3lf\n", x, y);

	}

	return 0;

}

C++: #include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
int main() {
  int a, b, c, d, e, f;
  double x, y;
  while (cin >> a >> b >> c >> d >> e >> f) {
    x = (b * f - c * e) / (b * d - a * e);
    y = (a * f - c * d) / (a * e - b * d);
    printf("%.3f %.3f", floor(x * 1000.0) / 1000.0, floor(y * 1000.0) / 1000.0);
  }
  return 0;
}

C++: # include <algorithm>
# include <cassert>
# include <cctype>
# include <cstdio>
# include <cstdlib>
# include <cstring>
# include <cmath>
# include <iostream>
# include <map>
# include <queue>
# include <set>
# include <sstream>
# include <stack>
# include <string>
# include <vector>
# include <iomanip>

# define rep(i, n) for (int i = 0; i < (int)(n); i++)
# define irep(i, n) for (int i = int(n) - 1; i >= 0; i--)
# define FOR(i, m, n) for (int i = int(m); i < (int)(n); i++)

using namespace std;
typedef long long ll;


// %% begin matrix %%

typedef vector<double> vec;
typedef vector<vec> mat;

void pretty_print(mat g) {
  rep (i, g.size()) {
    rep (j, g[0].size()-1) {
      cout << g[i][j] << ' ';
    }
    cout << g[i][g[0].size()-1] << endl;
  }
}


mat mul(mat A, mat B) {
  mat C(A.size(), vec(B.size()));
  rep (i, A.size()) {
    rep (k, B.size()) {
      rep (j, B[0].size()) {
        C[i][j] += A[i][k] * B[k][j];
      }
    }
  }
  return C;
}

// %% end matrix %%


vec jordan(mat &A, vec &b) {
  int n = A.size();

  // ?????§?????°??????
  mat B(n, vec(n+1));
  rep (i, n) {
    rep (j, n) {
      B[i][j] = A[i][j];
    }
    B[i][n] = b[i];
  }


  rep (i, n) {
    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]) < 0.0000001) {
      return vec();
    }

    for (int j = i+1; j <= n; j++) B[i][j] /= B[i][i];
    rep (j, n) {
      if (i != j) {
        for (int k = i+1; k <= n; k++) {
          B[j][k] -= B[j][i] * B[i][k];
        }
      }
    }
  }

  vec x(n);
  rep (i, n) {
    x[i] = B[i][n];
  }

  return x;
}




int main() {

  rep (iter, 2) {

    double a, b, c, d, e, f;
    cin >> a >> b >> c >> d >> e >> f;

    mat A = {
      {a, b},
      {d, e}
    };

    vec B = {
      c, f
    };

    vec x = jordan(A, B);
    cout << x[0] << " " << x[1] << endl;
  } 
}

C++: #include<iostream>
#include<iomanip>

using namespace std;

int main(){

double x, y, a, b, c, d, e, f;

while(cin >> a >> b >> c >> d >> e >> f){

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

cout << setprecision(3) << x << " " << y;
}
}

C++: #include <iostream>
#include <stdio.h>
#include <vector>
using namespace std;
int main() {
 int cn=0;
 double a,b,c,d,e,f;
 vector<double> x,y;
 while(cin >> a >> b >> c >> d >> e >> f) {
	 y.push_back((c-f*a/d)/(b-e*a/d));
	 x.push_back((c-b*y[cn++])/a);
	 }
 for (cn;cn>0;cn--) printf("%.3f %.3f\n",x[cn-1],y[cn-1]); 
 return 0;
}

C++: #include <iostream>

int main()
{
        int a, b, c, d, e, f;
        double y;
        std::cout.precision(3);
        std::cout.setf(std::ios::fixed);
        while(std::cin >> a >> b >> c >> d >> e >> f)
        {
                if(a != 0)
                {
                        y = (f - d*c/(double)a)/(e - d*b/(double)a);
                        std::cout << (c - b*y)/a << " " << y << std::endl;
                }
                else
                {
                        y = c/(double)b;
                        std::cout << (f - e*y)/d << " " << y << std::endl;
                }
        }
        return 0;
}

C++: #include<stdio.h>
int main(){
	double a,b,c,d,e,f,bb,cc,ee,ff,x,y;
	for(;;){
		if(scanf("%lf",&a)==EOF){break;}
		scanf("%lf",&b);
		scanf("%lf",&c);
		scanf("%lf",&d);
		scanf("%lf",&e);
		scanf("%lf",&f);
		bb=b*d;
		cc=c*d;
		ee=e*a;
		ff=f*a;
		y=(cc-ff)/(bb-ee);
		x=(c-b*y)/a;
		printf("%.3lf %.3lf\n",x,y);
	}
	return 0;
}

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