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 <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
using namespace std;

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

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

using namespace std;

int main(){
    int t;
    double a, b, c, d, e, f, x, y;
    cin >> t;
    while(t--){
        cin >> a >> b >> c >> d >> e >> f;
        y = (c/a - f/d)/(b/a - e/d);
        x = (c-b*y)/a;
        cout << x << " " << y << endl;
    }
    return 0;
}

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

int main() {
	double a, b, c, d, e, f;
	double x, y;
	double det;
	while (cin >> a >> b >> c >> d >> e >> f) {
		det = a * e - b * d;
		x = (e * c - b * f) / det;
		y = (-d * c + a * f) / det;
		cout << fixed << setprecision(3);
		cout << x << " " << y << endl;
	}
}

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

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

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

C++: #include <iostream>
#include <cstdio>
#define EPS 1e-10
using namespace std;

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

C++: import java.text.DecimalFormat;
import java.util.Scanner;

class Main {
public static void main(String[] args){
	Scanner scan = new Scanner(System.in);
	double a = Double.parseDouble(scan.next());
	double b = Double.parseDouble(scan.next());
	double c = Double.parseDouble(scan.next());
	double d = Double.parseDouble(scan.next());
	double e = Double.parseDouble(scan.next());
	double f = Double.parseDouble(scan.next());
	DecimalFormat df = new DecimalFormat("0.000");
	double x =(c*e-b*f)/(a*e-b*d);
	double y = (a*f-c*d)/(a*e-b*d);
	x = Math.floor((x+0.5)*1000)/1000;
	x = Math.ceil((x-0.5)*1000)/1000;
	y = Math.floor((y+0.5)*1000)/1000;
	y = Math.ceil((y-0.5)*1000)/1000;

	System.out.println(df.format(x)+" "+df.format(y) );


}
}