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<bits/stdc++.h>
using namespace std;
int main()
{
 double a,b,c,d,e,f,z,x,y;
 while(cin>>a>>b>>c>>d>>e>>f)
 {

    z= a*e-b*d;
    x=(c*e-b*f)/z;
    y=(a*f-c*d)/z;
    printf("%.3lf %.3lf\n",(x==-0)?0:x,(y==-0)?0:y);
 }

 return 0;
}

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

#define ROUND_RANK 4

//ax+by=c
//dx+ey=f

//行列式の算出
double Calc_det(const double& p11, const double& p12, const double& p21, const double& p22) {
	return (p11*p22 - p12*p21);
}
//xの解の算出
double Calc_x(const double& det, const double& q1, const double& p22, const double& p12, const double& q2) {
	return ((q1*p22 - p12*q2) / det);
}
//yの解の算出
double Calc_y(const double& det, const double& q2, const double& p11, const double& q1, const double& p21) {
	return ((q2*p11 - p21*q1) / det);
}
//少数点以下第rank位で四捨五入
double Round(const double& value, const int& rank) {
	int root = pow(10, rank);
	return (std::round(value*root) / root);
}

int main() {
	double	a, b, c, d, e, f;//データセット
	double  det;//行列式
	double	x, y;//解
	std::cin >> a >> b >> c >> d >> e >> f;
	det = Calc_det(a, b, d, e);
	x = Calc_x(det, c, e, b, f);
	y = Calc_y(det, a, f, c, d);
	x = Round(x, ROUND_RANK);
	if (x == 0)x = 0;
	y = Round(y, ROUND_RANK);
	if (y == 0)y = 0;
	std::cout << std::fixed;
	std::cout << std::setprecision(3) << x << " ";
	std::cout << std::setprecision(3) << y << std::endl;
}

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

int main(void){
    double a, b, c, d, e, f, x, y;
    while(scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF){
        x = (b*f - c*e)/(b*d - a*e);
        y = (a*f - c*d)/(a*e - b*d);
        if(x == -0) x=0;
        if(y == -0) y=0;
        cout << fixed << setprecision(3) << x << " " << y << endl;
    }
    return 0;
}

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

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