Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextFloat64() (float64, error) {
	return strconv.ParseFloat(nextString(), 64)
}

func mathRound(f float64) float64 {
	return math.Floor(f + .5)
}

func round(x float64) float64 {
	if math.Abs(x) < 0.001 {
		return 0
	}
	return mathRound(x*1000) / 1000
}

func main() {
	scanner.Split(bufio.ScanWords)
	for {
		a, err := nextFloat64()
		if err != nil {
			break
		}
		b, _ := nextFloat64()
		c, _ := nextFloat64()
		d, _ := nextFloat64()
		e, _ := nextFloat64()
		f, _ := nextFloat64()

		detA := a*e - b*d
		x := (c*e - b*f) / detA
		y := (a*f - c*d) / detA

		fmt.Printf("%.3f %.3f\n", round(x), round(y))
	}
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#define N 2

using namespace std;
typedef vector< vector<double> > const_vector;

bool input(const_vector& c)
{
	for (int i = 0; i < N; ++i)
		for (int j = 0; j < N + 1; ++j)
			cin >> c[i][j];

	return true;
}

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);

	const_vector c(N, vector<double>(N + 1));
	while (input(c))
	{
		// ??¬??????????¶???????
		// ???????¶????
		for (int i = 0; i < N - 1; ++i)
			for (int j = i + 1; j < N; ++j)
			{
				double d = c[j][i] / c[i][i];
				for (int k = i + 1; k <= N; ++k)
					c[j][k] -= c[i][k] * d;
			}

		// ????????£??\
		for (int i = N - 1; i >= 0; --i)
		{
			double d = c[i][N];
			for (int j = i + 1; j < N; ++j)
				d -= c[i][j] * c[j][N];
			c[i][N] = d / c[i][i];
		}

		// ????????????
		cout << setprecision(4) << fixed << c[0][N];
		for (int i = 1; i < N; ++i)
			cout << " " << c[i][N];
		cout << endl;
	}

	return 0;
}

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

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

int main() {
	// your code goes here

  int a,b,c,d,e,f;

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

    double x = (c*e-b*f)/(double)(a*e-b*d);
    double y = (c*d-a*f)/(double)(b*d-a*e);
    if(x == -0.0 || y == -0.0){
      x = 0.0;
      y = 0.0;
    }

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

  }
	return 0;
}

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

main(){
  
  double a,b,c,d,e,f;
  double x, y;
  

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

    y = (c*d - f*a)/(b*d-e*a);
    x = (c - b*y)/a;
    
    
    x*=10000;
    y*=10000;
    
    x+=0.5;
    y+=0.5;
    
    x/=10000;
    y/=10000;
    
    //cout << x << y << endl;
    printf("%.3f %.3f\n", x, y);
  }

  return 0;
}

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

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

C++: #include <stdio.h>
#include <iostream>
#include <algorithm>
using namespace std;

int main(){
	float a,b,c,d,e,f,i,n;
	while(cin >> a >> b >> c >> d >> e >> f){
		printf("%6.3f %6.3f\n",(c*e-b*f)/(a*e-b*d) ,(c*d-a*f)/(b*d-a*e));
	}
	return 0;
}

C++: #include <stdio.h>
float round3(float a){
	a=a*10000;
	if(int(a)%10>5)a+10;
	a=double (int (a));
	a=a/10000;

}
int main(){
	int a,b,c,d,e,f;
	double x,y;
	while((scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f))!=EOF){
		if(a*e==b*d){
		}else{
			x=(c*e-b*f)/(a*e-b*d);
			y=(c*d-a*f)/(b*d-a*e);
		}
		x=round3(x);
		y=round3(y);
		printf("%0.3lf %0.3lf\n",x,y);
	}
	return 0;
}

C++: #include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <cmath>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <iostream>
#include <random>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include <fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <bitset>
using namespace std;

using ll = long long;
using vll = vector<ll>;
using pll = pair<ll, ll>;
using qll = queue<ll>;
using vb = vector<bool>;
using mll = map<ll, ll>;
using sll = stack<ll>;
using vec = vector<double>;
using mat = vector<vec>;
#define REP(i,n) for(ll i(0);(i)<(n);(i)++)
#define rep(i,n) for(ll i(0);(i)<(n);(i)++)
#define ALL(a) a.begin(), a.end()
#define elnd endl //* missspell check
const ll INF = 1LL << 60;
const double EPS = 1E-8;
//* Solve Ax = b. A is a square matrix in O(n^3)
//* Return 0-length vector if unsolvable/not-unique
//* partial pivoting
vec GaussJordan(const mat &A, const vec &b){
    ll n = A.size();
    mat B(n, vec(n+1)); //* last columb for solution
    //* initialize B
    REP(i, n) REP(j, n) B[i][j] = A[i][j];
    REP(i, n) B[i][n] = b[i];

    REP(i, n){
        ll pivot = i;
        for(ll j = i; j < n; j++){
            if(abs(B[j][i]) > abs(B[pivot][i])) pivot = j;
        }
        swap(B[i], B[pivot]); //* swap i-th row and pivot-th row
        if(abs(B[i][i]) < EPS) return vec();

        for(ll j = i+1; j <=n; j++) B[i][j] /= B[i][i];
        //* eliminition
        for(ll j = 0; j < n; j++){
            if(i != j){
                for(ll k = i+1; k <= n; k++) B[j][k] -= B[j][i] * B[i][k];
            }
        }
    }
    //* prepare solution
    vec x(n);
    for(ll i=0; i < n; i++) x[i] = B[i][n];
    return x;
}

//! http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0004&lang=ja
int main(){
    mat A(2, vec(2));
    vec b(2);
    while(scanf("%lf %lf %lf %lf %lf %lf",&A[0][0],&A[0][1],&b[0],&A[1][0],&A[1][1],&b[1])!=EOF){
        vec x = GaussJordan(A, b);
        printf("%.3lf %.3lf\n",x[0],x[1]);
    }
    return 0;
}

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

struct vector2{
	float x, y;
	vector2() : x(0), y(0){}
	vector2(float x, float y) : x(x), y(y){}
};

struct sim_elem{
	float a, b, c, d, e, f;
	sim_elem() :a(0), b(0), c(0), d(0), e(0), f(0){}
	sim_elem(float a, float b, float c, float d, float e, float f) :a(0), b(0), c(0), d(0), e(0), f(0){}
};

//	a / d * d
//	ey - by = f - c
//	y / y = (f - c) / y

// ax = -by + c
// ax / a = -(by + c) / a

vector2 sim_equ(sim_elem elem){

	float dx = elem.a / elem.d * elem.d;
	float ey = elem.a / elem.d * elem.e;
	float f = elem.a / elem.d * elem.f;

	float y = ey - elem.b;
	float yr = f - elem.c;
	y = yr / y;

	float ax = -elem.b * y + elem.c;
	float x = ax / elem.a;

	return vector2(x, y);
}

//	sprintf
float placement4(float val){
	char ret[128];
	sprintf_s(ret, sizeof(ret), "%.3f", val);
	return (float)atof(ret);
}

int main(){

	sim_elem elem;
	while (1){
		cin >> elem.a >> elem.b >> elem.c >> elem.d >> elem.e >> elem.f;
		if (cin.eof())break;
		vector2 ret;
		ret = sim_equ(elem);
		printf("%.3f %.3f\n", placement4(ret.x) ,placement4(ret.y) );
	}

	return 0;
}

C++: #include <math.h>
#include <iostream>
#include <ios>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <string>

#define YES "YES"
#define NO "NO"
#define space ' '

using namespace std;

void func();

int main(void)
{
	
	func();

	return 0;
}

// using matrix	?????????????????´??????
void func()
{
	double a, b, c, d, e, f;
	double x, y;

	while (cin >> a >> b >> c >> d >> e >> f, !cin.eof()){


		cout << fixed << setprecision(3);


		if ((a*e - d*b) == 0)
			x = 0.0, y = 0.0;
		else {
			x = (double)((e*c - b*f) / (a*e - d*b));
			y = (double)((-(d*c) + a*f) / (a*e - d*b));


			if (x == 0)
				x = 0.0;
			if (y == 0)
				y = 0.0;
		}
		cout << x << space << y << endl;


		cout << dec;
	}
}