Go: package main

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

func gcd(num1, num2 int) int {
	if num2 == 0 {
		return num1
	}
	num3 := num1 % num2
	return gcd(num2, num3)
}

func lcm(num1, num2 int) int {
	if num1%num2 != 0 {
		num3 := gcd(num1, num2)
		for i := 1; ; i++ {
			check := num3 * i
			if check%num1 == 0 && check%num2 == 0 {
				return check
			}
		}
	} else {
		return num1
	}
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	for scanner.Scan() {
		strNums := strings.Fields(scanner.Text())
		nums := []int{}
		for _, strNum := range strNums {
			num, _ := strconv.Atoi(strNum)
			nums = append(nums, num)
		}
		a := nums[0]
		b := nums[1]
		c := nums[2]
		d := nums[3]
		e := nums[4]
		f := nums[5]
		lcm := lcm(a, d)
		mulA := lcm / a
		mulD := lcm / d
		a *= mulA
		b *= mulA
		c *= mulA
		d *= mulD
		e *= mulD
		f *= mulD

		if d < 0 {
			d *= -1
			e *= -1
			f *= -1
		}

		bE := b - e
		cF := c - f
		if bE==0{
		    bE=1
		}
		y := cF / bE
		x := (c - (y * b)) / a

		
			fmt.Printf("%d.000 ", x)
			fmt.Printf("%d.000\n", y)
	}
}

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;

}