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
		y := float64(cF) / float64(bE)
		x := (float64(c) - (y * float64(b))) / float64(a)

		if x == 0 {
			fmt.Printf("%.3f ", 0.0)
		} else {
			fmt.Printf("%.3f ", x)
		}
		if y == 0 {
			fmt.Printf("%.3f\n", 0.0)
		} else {
			fmt.Printf("%.3f\n", y)
		}
	}
}

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

int det(int a00, int a01, int a10, int a11)
{
	return a00*a11 - a01*a10;
}

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

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

using namespace std;

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

        if (x == -0) x = 0;
        if (y == -0) y = 0;
        printf("%.3f %.3f\n", x, y);
    }
}

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

using namespace std;

int main()
{
    double a, b, c, d, e, f;
    double answer1, answer2;

    while (cin >> a >> b >> c >> d >> e >> f) {
        answer1 = static_cast<double>(e * c - b * f) / (a * e - b * d);
        answer2 = static_cast<double>(-d * c + a * f) / (a * e - b * d);
        if (answer1 == 0) answer1 = 0.000;
        if (answer2 == 0) answer2 = 0.000;
        cout << fixed << setprecision(3) << round(answer1) << " " << round(answer2) << endl;
    }
    
    return 0;
}

C++: #include <iostream>
#include <cstdio>
#ifndef repeat
#define repeat(i,n) for (int i = 0; i < (n); ++i)
#endif
#ifndef repeat_from
#define repeat_from(i,m,n) for (int i = (m); i < (n); ++i)
#endif
#ifndef repeat_one
#define repeat_one(i,n) for (int i = 1; i <= (n); ++i)
#endif
#ifndef repeat_rev
#define repeat_rev(i,n) for (int i = (n)-1; 0 <= i; --i)
#endif
#ifndef foreach
#define foreach(it, cont) for (typeof(cont.begin()) it = cont.begin(); it != cont.end(); ++it)
#endif
#include <vector>
#include <cmath>
#ifndef repeat
#define repeat(i,n) for (int i = 0; i < (n); ++i)
#endif
#ifndef repeat_from
#define repeat_from(i,m,n) for (int i = (m); i < (n); ++i)
#endif
#ifndef repeat_one
#define repeat_one(i,n) for (int i = 1; i <= (n); ++i)
#endif
#ifndef repeat_rev
#define repeat_rev(i,n) for (int i = (n)-1; 0 <= i; --i)
#endif
#ifndef foreach
#define foreach(it, cont) for (typeof(cont.begin()) it = cont.begin(); it != cont.end(); ++it)
#endif
#ifndef LIB_DEBUG_HPP
#define LIB_DEBUG_HPP
#ifdef DEBUG
#include <cassert>
#define debug(a) a
#else
#define debug(a)
#endif
#endif
#include <iostream>

// a11x1 + a12x2 + ... + a1m-1xm-1 = a1m
// a21x1 + a22x2 + ... + a2m-1xm-1 = a2m
//      ...        ...            ...
// an1x1 + an2x2 + ... + anm-1xm-1 = anm
std::vector<double> gaussian_elim(std::vector<std::vector<double> > a) {
    const int n = a.size();
#ifdef DEBUG
    assert (0 < n);
#endif
    const int m = a[0].size();
#ifdef DEBUG
    repeat (i, n) assert ((int)a[i].size() == m);
    assert (n == m-1);
#endif
    // make an upper diagonal matrix
    repeat (i, n) {
        {
            int pivot = -1;
            repeat_from (j, i, n) {
                const double eps = 1e-16;
                if (eps < std::abs(a[j][i])) { pivot = j; break; }
            }
#ifdef debug
            assert (pivot != -1);
#endif
            if (pivot != i) std::swap(a[i], a[pivot]);
        }
        repeat_from (j, i+1, m) a[i][j] /= a[i][i];
        a[i][i] = 1;
        repeat_from (j, i+1, n) {
            repeat_from (k, i+1, m) {
                a[j][k] -= a[j][i] * a[i][k];
            }
            a[j][i] = 0;
        }
    }
    // gather the solutions
    std::vector<double> result(n);
    repeat_rev (i, n) {
        result[i] = a[i][m-1];
        repeat_from (j, i+1, n) {
            result[i] -= a[i][j] * result[j];
        }
    }
    return result;
}
using namespace std;
int main() {
    // ax + by = c
    // dx + ey = f
    vector<vector<double> > v(2, vector<double>(3));
    vector<double> w;
    while (true) {
        repeat (i,2) repeat (j,3) cin >> v[i][j];
        if (cin.fail()) break;
        w = gaussian_elim(v);
        printf("%.3lf %.3lf\n", w[0], w[1]);
    }
    return 0;
}

C++: #include <cstdio>

int main() {
    double a, b, c, d, e, f;
    double g, h, x, y;
        while ( scanf("%lf%lf%lf%lf%lf%lf", &a, &b, &c, &d, &e, &f) != EOF) {
              g = b*d;
              h = c*d;
              if ((a > 0) ^ (b > 0)) {
                    g = g + e;
                    h = h + f;
                    y = h / g;
              } else {
                     g = g - e;
                     h = h - f;
                     y = h / g;
                     }
              c = c - (b * y);
              x = c / a;
              printf("%.3f %.3f\n", x, y);
        }
        return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <queue>
using namespace std;
typedef long long int ll;
const int INF = 100000000;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
int main(){
    for(double a1, a2, b1, b2, c1, c2;cin >> a1 >> b1 >> c1 >> a2 >> b2 >> c2;){
        double x, y;
        bool swp = false;
        b2 -= b1 * (a2 / a1);
        c2 -= c1 * (a2 / a1);
        y = c2 / b2;
        x = (c1 - y * b1) / a1;
        printf("%.3f %.3f\n", x, y);
    }
    return 0;   
}

C++: #include<iostream>
int main(){for(float a,b,c,d,e,f,x,y;;printf("%.3f %.3f\n",x,y)){if((std::cin>>a>>b>>c>>d>>e>>f).eof())break;y=(c*d-a*f)/(b*d-a*e);x=d?f/d-e*y/d:c/a-b*y/a;}}

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

using namespace std;

int main(){
 double x,y,a,b,c,d,e,f;
 while(cin>>a>>b>>c>>d>>e>>f){
  x=(c*e-f*b)/(a*e-d*b);
  y=(a*f-d*c)/(a*e-d*b);
  if(abs(x)<=(0.0+numeric_limits<double>::epsilon())) x = +0.00000000;
  if(abs(y)<=(0.0+numeric_limits<double>::epsilon())) y = +0.00000000;
  cout << fixed << setprecision(3) << x << " " << y << endl;
 }
 return 0;
}

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

int main()
{
	int a, b, c, d, e, f;
	cout << showpoint << setprecision(3);
	while (cin >> a >> b >> c >> d >> e >> f){
		double x = ((double)(b*f - c*e)) / (double)(b*d - a*e);
		double y = ((double)(c*d - a*f)) / (double)(b*d - a*e);
		cout << x << ' ' << y << "\n";
	}
	cout.flush();
}

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

int main ()
{
    ///freopen("input.txt","r",stdin);
    ///ios_base::sync_with_stdio(0);
    ///cin.tie(0);
    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=(c*e-b*f)/(a*e-b*d);
        y=(a*f-c*d)/(a*e-b*d);
        if (x==0.000 && y!=0.000)
            printf("0.000 %.3lf\n",y);
        else if(x!=0.000 && y==0.000)
            printf("%.3lf %0.000\n",x);
        else
            printf("%.3lf %.3lf\n",x,y);
    return 0;
}
}