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 <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
constexpr double eps = 1e-8;

int main() {
  double a, b, c, d, e, f, x, y;
  while (cin >> a >> b >> c >> d >> e >> f) {
    x = (c * e - b * f) / (a * e - b * d);
    y = (c - a * x) / b;
    if (fabs(x) < eps) x = 0;
    if (fabs(y) < eps) y = 0;
    cout << fixed << setprecision(3) << x << " " << y << endl;
  }
}

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

double round(double num);
/*
??£???????¨????
	ax + by = c
	dx + ey = f
????§£x, y???????????????????????°??????
*/
int main() {
	double a, b, c, d, e, f;
	int cnt = 0;						//??\??????????????£???????¨????????????°
	std::vector<double> x_vector;		//x????§£???????´?
	std::vector<double> y_vector;		//y????§£???????´?

#if 1
	while (cnt < 1) {
		cin >> a >> b >> c >> d >> e >> f;
#else
	while (cin >> a >> b >> c >> d >> e >> f) {
#endif
		double x = (b * f - c * e) / (b * d - a * e);
		double y = (c * d - a * f) / (b * d - a * e);

		cnt++;
		x_vector.push_back(x);
		y_vector.push_back(y);
	}

	for (unsigned int i = 0; i < cnt; i++) {
		double x_result = round(x_vector[i]);
		double y_result = round(y_vector[i]);

		std::cout << std::fixed;
		std::cout << std::setprecision(3) << x_result << " ";
		std::cout << std::setprecision(3) << y_result << endl;
	}

	//???????????°
	//while (1);

	return 0;
}

//?°???°????¬¬4???????????¨?????\????????¢??°
double round(double num) {
	int num_mul_10000 = (int)(double)(num * 10000);
	int num_mul_1000  = (int)(double)(num * 1000);

	//???????????°
	cout << num_mul_10000 << " " << num_mul_1000 << endl;

	if (5 <= (num_mul_10000 - num_mul_1000 * 10)) {
		return num + 0.001;
	}
	else {
		return num;
	}
}

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

int main(){

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

C++: from sympy import *

a, b, c, d, e, f = map(int, raw_input().strip().split(' '))

x, y = symbols('x y')

# ax + by = c
# dx + ey = f
res = solve((a*x+b*y - c , d*x+e*y - f), x, y)
x = res[x]
y = res[y]
x = float(str(x))
y = float(str(y))
print "%.3f %.3f" % (x, y)

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

int main() {
	double a, b, c, d, e, f, x, y;
	cout << fixed << setprecision(3);
	while (cin >> a >> b >> c >> d >> e >> f) {
		x = (c * e - b * f) / (a * e - b * d);
		y = (c - a * x) / b;
		x *= 1000; x = x + (x > 0 ? 0.5 : -0.5); x = (int)x;
		y *= 1000; y = y + (y > 0 ? 0.5 : -0.5); y = (int)y;
		cout << x / 1000 << " " << y / 1000 << endl;
	}
	return 0;
}

C++: #include <cstdio>

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;
    y = (c*d - a*f)*1.0/(b*d - a*e);
    x = (c - b*y)/a;
    printf("%.3lf %.3lf\n", x, y);
  }
  return 0;
  
}

C++: #include <bits/stdc++.h>

using namespace std;

#define Vi vector<int>
#define FOR(i,s,e) for (int i=s; i<e; i++)
#define ITER(v) v.begin(), v.end()

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

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

    while (true) {
        cin >> a >> b >> c >> d >> e >> f;
        if (cin.eof()) { break; }
        den =  a * e - b * d;
        x = static_cast<double>(c * e - b * f) / den;
        y = static_cast<double>(- c * d + a * f) / den;
        // avoid -0.000
        x += 0.0;
        y += 0.0;
        cout << fixed << setprecision(3) << x << " " << y << endl;
    }

    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];


		if(x >= 0) x = ((double)((int)(x*1000+0.5)))/1000;
		else x = ((double)((int)(x*1000-0.5)))/1000;
		if(y >= 0) y = ((double)((int)(y*1000+0.5)))/1000;
		else y = ((double)((int)(y*1000+0.5)))/1000;

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

C++: #include<cstdio>
#include<cmath>
#include<algorithm>
#define rep(i,a,b) for(int i = (a); i<=(b); i++)
using namespace std;
const int num = 100;
double matrix[num][num + 1];   //邉サ謨ー遏ゥ髦オ?御サ?蠑?ァ?double ans[num];               //扈捺棡謨ー扈?
void exchange_col(int p1,int p2,int n)  //莠、謐「p1陦悟柱p2陦檎噪謇?怏謨ー謐ョ
{
    double t;
    int i;
    for(i = 0 ; i <= n ; i++)
        t = matrix[p1][i],matrix[p1][i] = matrix[p2][i],matrix[p2][i] = t;
}

bool gauss(int n)   //豎りァ」邉サ謨ー遏ゥ髦オ荳コn逧?コソ諤ァ譁ケ遞狗サ?{
    int i,j,k;
    int p;
    double r;

    for(i = 0 ; i < n - 1 ; i++)
    {
        p = i;
        for(j = i + 1 ; j < n ; j++)     //蟇サ謇セi蛻玲怙螟ァ蛟シ菴咲スョ
        {
            if(matrix[j][i] > matrix[p][i])
                p = j;
        }
        if(matrix[p][i] == 0) return false;
        if(p != i)     exchange_col(i,p,n);
        for(j = i + 1 ; j < n ; j++)         //蜑ゥ菴吝?霑幄。梧カ亥?
        {
            r = matrix[j][i] / matrix[i][i];
            for(k = i ; k <= n ; k++)
                matrix[j][k] -= r * matrix[i][k];
        }
    }
    for(i = n - 1 ; i >= 0 ; i--)     //闔キ蠕礼サ捺棡
    {
        ans[i] = matrix[i][n];
        for(j = n - 1 ; j > i ; j--)
            ans[i] -= matrix[i][j] * ans[j];
        ans[i] /= matrix[i][i];
    }
    return true;
}
int main()
{
    int i,j,t;
    while(scanf("%lf",&matrix[0][0])!=-1)
    {
        rep(i,1,2) scanf("%lf",&matrix[0][i]);
        rep(i,0,2) scanf("%lf",&matrix[1][i]);
        gauss(2);
        printf("%.3lf %.3lf\n",ans[0],ans[1]);
    }
    return 0;
}

C++: #include <stdio.h>
#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

int main() {

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

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

	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;
while(cin >> a >> b >> c >> d >> e >> f){
  if(a*e-b*d != 0){
    x = (e*c-b*f) / (a*e-b*d);
    y = (-(d*c)+a*f) / (a*e-b*d);
  }

  printf("%1.3f %1.3f\n",x,y);
 }
}

C++: #include <iostream>
#include <stdio.h>
#include <iomanip>
//#include <vector>
//#include <string>
//#include <algorithm>
//#include <functional>

using namespace std;

int main(){

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

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



	return 0;
}

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