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 <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>

// ax + by = c
// dx + ey = f
// det(A) = ae-bd
// A^(-1) = 1/det(A)* ((e,-b),(-d,a))
// x = 1/det(A) *(ce-bf)
// y =			*(-cd+af)

int main(int,char**){
	double a,b,c,d,e,f;
	double x,y;
	std::cout<< std::setprecision(3) << std::setiosflags(std::ios::fixed);
	while(std::cin >> a){
		std::cin >> b >> c >> d >> e >> f;
		double det(a*e-b*d);
		x= (c*e-b*f)/det;
		if(x<0 && x>-0.001) x= 0.000;
		y= (-c*d+a*f)/det;
		if(y<0 && y>-0.001) y= 0.000;
		std::cout<< x << ' ' << y<<std::endl;
	}
	return 0;
}

C++: #include <cmath>
#include <iomanip>
#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 - b * f) / (a * e - b * d);
    double y = (c * d - a * f) / (b * d - a * e);
    x = floor(x * 10000 + .5) / 10000;
    y = floor(y * 10000 + .5) / 10000;
    cout << fixed << setprecision(3) << x << " " << y << endl;
  }
}