Go: package main

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

var sc = bufio.NewScanner(os.Stdin)

func read() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	sc.Split(bufio.ScanLines)
	for sc.Scan() {
		s := strings.Split(sc.Text(), " ")
		a, _ := strconv.ParseFloat(s[0], 64)
		b, _ := strconv.ParseFloat(s[1], 64)
		c, _ := strconv.ParseFloat(s[2], 64)
		d, _ := strconv.ParseFloat(s[3], 64)
		e, _ := strconv.ParseFloat(s[4], 64)
		f, _ := strconv.ParseFloat(s[5], 64)
		x := ((b * f) - (c * e)) / ((b * d) - (a * e))
		y := ((a * f) - (c * d)) / ((a * e) - (b * d))
		if x == 0 {
			fmt.Printf("0.000 %.3f\n", y)
		} else if y == 0 {
			fmt.Printf("%.3f 0.000\n", x)
		} else {
			fmt.Printf("%.3f %.3f\n", x, y)
		}
	}
}

C++: #include<stdio.h>
int main(){
	double a,b,c,d,e,f,x,y;
	while(scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f)!=-1){
		x=((c*e-f*b)/(a*e-d*b));
		y=((c-a*x)/b);
		if(x>0)x+=0.0005;
		else x-=0.0005;
		if(y>0)x+=0.0005;
		else y=-0.0005;
		printf("%.3ld %.3ld",x,y);
	}
	return 0;
}

C++: #include <iostream>
#include <stdio.h>
using namespace std;
 
int main() {
	double a,b,c,d,e,f;
	while (cin >> a >> b >> c >> d >> e >> f) {
		// ???????????????(???????????????????????????????????????)
		// ?¬¬?????????x????????°???1?????????
		b /= a;
		c /= a;
		a = 1;
		// ????????¶?????§???????¨???? (e-bd)y = f-cd ?????????????????????
		double y = (f - c*d) / (e - b*d);
		double x = c - b * y;
		printf ("%1.3f %1.3f",x,y);
		cout << endl;
	}
	return 0;
}

C++: #include <cstdio>
using namespace std;
int main()
{
	int a, b, c, d, e, f;
	while (scanf("%d%d%d%d%d%d", &a,&b,&c,&d,&e,&f) != EOF) {
		double x, y;
		int p = b*d - a*e;
		x = (double)(b*f - c*e) / p;
		y = (double)(c*d - a*f) / p;
		printf("%.3f %.3f\n", x, y);
	}
	return 0;
}

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

int main(){
	int a,b,c,d,e,f;
	
	cout<<"ax+by=c"<<endl<<"dx+ef=f"<<endl;
	cout<<"		????§£???x,y??????????????????"<<endl;
	
	cout<<"a b c d e f >>>>";
	cin>>a>>b>>c>>d>>e>>f;
	
	cout<<"x="<<(e*c-b*f)/(a*e-b*d)
		<<"y="<<(-c*d+a*f)/(a*e-b*d)<<endl;
	return 0;
}

C++: (function set_utils(undefined){
	this.print_float = function print_float(val, base, pad, prec) {
		var p10=Math.pow(10,prec);
		var ival=""+Math.round(val*p10);
		if ( ival === '0' )
			return '0.'+Array(prec+1).join('0');
		var ilen=ival.length-prec;
		if(ilen===0)
			return "0."+ival.substr(ilen,prec);
		return ival.substr(0,ilen)+"."+ival.substr(ilen,prec);
	};
}).call(global);

(function(undefined){
	'use strict';

	(function init() {
		this.output = function() {
			console.log.apply( console, arguments );
		};
		this.stdin = process.openStdin();
		stdin.setEncoding('utf8');
		this.input_list = [];
		stdin.on('data', function(chunk){
			var result = chunk.match(/[-]?\d+/g);
			input_list = input_list.concat(result);
		});
		stdin.on('end', function(){
			fire();
		});
		this.input_number = function() {
			return parseInt( input_list.splice(0,1)[0] );
		};
		this.has_next = function() {
			return ! input_list.length;
		};
	}).call( this );

	(function solver(){
		function sq(x) {
			return x * x;
		}
		function check(v) {
		}
		this.fire = function() {
			setTimeout( function solve() {
				var a = input_number();
				var b = input_number();
				var c = input_number();
				var d = input_number();
				var e = input_number();
				var f = input_number();
				var delta = 1.0 / ( a*e - b*d );
				var x = ( e * c - b * f ) * delta;
				var y = ( a * f - d * c ) * delta;
				output( print_float(x,10,3,3) + ' ' + print_float(y,10,3,3)  );
				if ( ! has_next() )
					setTimeout( solve, 0, this );
			}, 0, this );
		};
	}).call(this);

}).call(global);

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

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

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

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

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

int main(){
	double a,b,c,d,e,f,x,y;
	while(true){
		cin>>a>>b>>c>>d>>e>>f;
		if(cin.eof()) break;
		x=(b*f-c*e)/(b*d-a*e);
		y=(c-a*x)/b;
		x=round(x*1000.0)/1000.0;
		y=round(y*1000.0)/1000.0;
		if(x-0.0<0.001&&x-0.0>-0.001) x=0.0;
		if(y-0.0<0.001&&y-0.0>-0.001) y=0.0;
		cout<<x<<" "<<y<<endl;//debug
		printf("%.3f %.3f\n",x,y);
	}
	return 0;
}

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);
  }
}