Go: package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Split(bufio.ScanWords)
	for {
		data := nextInts(6)
		if data[0] == 0 || data[1] == 0 || data[2] == 0 || data[3] == 0 || data[4] == 0 || data[5] == 0 {
			break
		}
		fmt.Printf("%.3f\n", Round(GetX(data[0], data[1], data[2], data[3], data[4], data[5]), 3))
		fmt.Printf("%.3f\n", Round(GetY(data[0], data[1], data[2], data[3], data[4], data[5]), 3))
	}
}

func GetX(a, b, c, d, e, f float64) float64 {
	return ((c * e) - (b * f)) / ((a * e) - (b * d))
}

func GetY(a, b, c, d, e, f float64) float64 {
	return ((c * d) - (a * f)) / ((b * d) - (a * e))
}

func Round(f float64, places int) float64 {
	shift := math.Pow(10, float64(places))
	return math.Floor(f*shift+.5) / shift
}

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

func nextInt() float64 {
	a, _ := strconv.Atoi(next())
	return float64(a)
}

func nextInts(n int) []float64 {
	a := make([]float64, n)
	for i := 0; i < n; i++ {
		a[i] = nextInt()
	}
	return a
}

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

#define all(c) (c).begin(), (c).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb(e) push_back(e)
#define mp(a, b) make_pair(a, b)
#define fr first
#define sc second

typedef unsigned long long ull;
typedef long long ll;

const int INF=100000000;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

using namespace std;

typedef pair<int ,int > P;

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

int main()
{

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

	}
	


	return 0;
}

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

double halfadjust(double x){
	int tmp = (x*10000);
	tmp = tmp%10;
	double ans = static_cast<double>(static_cast<int>(x*1000));
	ans = ans/1000;
	if(tmp >= 5)
		ans += 0.001;
	if(tmp <= -5)
		ans -= 0.001;
	return ans;
}

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

void solve(){
	using namespace std;
	double x = (c*e-b*f)/(a*e-b*d);
	double y = (c*d-a*f)/(b*d-a*e);
	cout << setprecision(3) << fixed << halfadjust(x) << ' ';
	cout << halfadjust(y) << endl;
	cout << setprecision(6);
}

int main(){
	while(true){
		std::cin >> a >> b >> c >> d >> e >> f;
		if(!a&&!b&&!c&&!d&&!e&&!f)
			break;
		solve();
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

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

C++: #include <iostream>

auto main () -> int
{
    int a , b , c , d , e , f;
    while (std::cin >> a >> b >> c >> d >> e >> f)
    {
        auto delta = a * e - b * d;
        auto x = 1000ll * (e * c - b * f) / delta;
        auto y = 1000ll * (- c * d + a * f) / delta;
        std::printf ("%lld.%03lld %lld.%03lld\n" , x / 1000 , x % 1000 , y / 1000 , y % 1000);
    }
}

C++: #include <cassert>
#include <cstdio>

int main() {
    float a, b, c, d, e, f;
    while(~scanf("%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f)) {
        float det = a*e - b*d;
        assert(det != 0);
        float inv[2][2] = { {e / det, -b / det}, {-d / det, a / det} };
        printf("%.3f %.3f\n", (inv[0][0] * c + inv[0][1] * f), (inv[1][0] * c + inv[1][1] * f));
    }
}

C++: #include <iomanip>
#include <iostream>
#include <vector>
#define N 2
 
using namespace std;
typedef vector< vector<double> > Equation;
 
int main()
{ 
    Equation c(N, vector<double>(N + 1));
	while (cin)
	{
		// input
		for (int i = 0; i < N; ++i)
			for (int j = 0; j < N + 1; ++j)
				cin >> c[i][j];

		// Gaussian elimination
		// 1. Forward elimination
        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;
            }
 
		// 2. Back substitution
        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(3) << fixed << c[0][N];
        for (int i = 1; i < N; ++i)
            cout << " " << c[i][N];
        cout << endl;
    }
 
    return 0;
}

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

int main(void){
	double a,b,c,d,e,f;
	double x,y;
	cout << fixed;
	cout.precision(3);
	while(cin >> a >>b >> c >> d >> e >>f){
		b/=a; c/=a; a=1.0;
		e/=d; f/=d; d=1.0;
		y=(c-f)/(b-e); if(y==0) y=0;
		x=c-b*y; if(x==0) x=0.0;
		cout << x << " " << y << endl;
	}
	return 0;
}

C++: #include<stdio.h>
#include<math.h>
double sg(double x){
	if ( x > 0.0 ) {
		return floor(x + 0.0005);
	} else {
    	return -0.001 * floor(fabs(x) + 0.0005);
	}
}
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)!=EOF){
		y=sg(((c*d)-(a*f))/((b*d)-(a*e)));
		x=sg(((c*e)-(b*f))/((a*e)-(b*d)));
		printf("%4lf %4lf\n",x,y);
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;

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

	//小数点以下４桁で四捨五入して表示
	cout << fixed << setprecision(3) << x << " " << y << endl;

	return 0;
}

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

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

using namespace std;

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)+0.0;
		y = (c*d - a*f) / (b*d - a*e)+0.0;

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

	}

	return 0;

}