Go: package main

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

var sc = bufio.NewScanner(os.Stdin)

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

func main() {
	sc.Split(bufio.ScanLines)
	for sc.Scan() {
		s := strings.Split(sc.Text(), " ")
		a, _ := strconv.ParseFloat(s[0], 64)
		b, _ := strconv.ParseFloat(s[1], 64)
		c, _ := strconv.ParseFloat(s[2], 64)
		d, _ := strconv.ParseFloat(s[3], 64)
		e, _ := strconv.ParseFloat(s[4], 64)
		f, _ := strconv.ParseFloat(s[5], 64)
		x := ((b * f) - (c * e)) / ((b * d) - (a * e))
		y := ((a * f) - (c * d)) / ((a * e) - (b * d))
		if x == 0 {
			fmt.Printf("0.000 %.3f\n", y)
		} else if y == 0 {
			fmt.Printf("%.3f 0.000\n", x)
		} else {
			fmt.Printf("%.3f %.3f\n", x, y)
		}
	}
}

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

using namespace std;

int main() {
    double a, b, c, d, e, f, x, y, det;
    while (true) {
        cin >> a >> b >> c >> d >> e >> f;
        if (cin.eof()) {
            return 0;
        }
        det = a*e-b*d;
        x = (c*e-b*f)/det;
        y = (a*f-c*d)/det;
        if (x < 0.0005) {
            x = 0;
        }
        if (y < 0.0005) {
            y = 0;
        }
        cout << std::fixed << setprecision(3) << x << ' ' << y << endl;
    }
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){

double a,b,c,d,e,f;
while(scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f)!=EOF){

    double det = (a*e) - (b*d);
    double xx = (c*e) - (b*f);
    double yy = (a*f) - (c*d);
    double x = xx/det;
    double y = yy/det;
    long long x0 = x , y0 = y;
    if(x0 == 0 ) x = 0.000;
    else if(y0 == 0) y = 0.000;
    printf("%.3lf %.3lf\n",x,y);
}
return 0;
}

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

double x,y;
int a,b,c,d,e,f;
int sisya = 1000;


void setX() {
    int ae, bd, ce, bf;
    
    ae = a * e;
    bd = b * d;
    ce = c * e;
    bf = b * f;
    
    x = (ce - bf) / (ae - bd);
    x *= sisya;
    if(x > 0) x += 0.5;
    else x -= 0.5;
    x = int(x);
    x /= sisya;
}

void setY() {
    int ae, af, cd, bd;
    
    bd = b * d;
    ae = a * e;
    cd = c * d;
    af = a * f;
    
    y = (cd - af) / (bd - ae);
    y *= sisya;
    if(y > 0) y += 0.5;
    else y -= 0.5;
    y = int(y);
    y /= sisya;
    
}

int main(void) {
    
    while(cin >> a >> b >> c >> d >> e >> f) {
        setX();
        setY();
        cout << setprecision(3);
        cout << setiosflags(ios::fixed);
        cout << x << " " << y << endl;
    }
    return 0;
}