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 <iostream>
#include <iomanip>
using namespace std;

int main(){
	double a[6];
	double x,y;
	cout<< setprecision(4) << setiosflags(ios::showpoint);
	while(true){
			if(cin.eof() == 1)
			break;
		cin >> a[0];
		cin >> a[1];
		cin >> a[2];
		cin >> a[3];
		cin >> a[4];
		cin >> a[5];

			
		x = (a[4]*a[2]-a[1]*a[5])/(a[0]*a[4]-a[1]*a[3]);
		y = (-a[3]*a[2]+a[0]*a[5])/(a[0]*a[4]-a[1]*a[3]);
		if(x == 0)
			x = 0;
		if(y == 0)
			 y = 0;
			 
		cout << x << " " << y << endl;
	}
	return 0;
}

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) );


}
}