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 <cstdio>
#include <cfloat>
#include <cmath>
#include <iostream>

int main()
{
    double a, b, c, d, e, f;
    while (std::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);
        if (fabs(x) < DBL_EPSILON) {
            x = 0.0;
        }
        if (fabs(y) < DBL_EPSILON) {
            y = 0.0;
        }
        printf("%.3f %.3f\n", x, y);
    }

    return 0;
}

C++: const int tt = 10000;

#include<iostream>
#include<string>
#include<sstream>
using namespace std;

string toStr(int n);
string intToString(int n);

int main() {
  int a, b, c, d, e, f;
  
  while(cin >> a >> b >> c >> d >> e >> f) {
    c = c * tt;
    f = f * tt;

    int det = a * e - b * d;

    int x = ( e * c - b * f) / det;
    int y = (-d * c + a * f) / det;
//    cout << x << y << endl;

    cout << toStr(x) << " " << toStr(y) << endl;
  }
}

string toStr(int n) {
  string pm, val;
  
  if (n < 0) {
    pm = "-";
    n = -n;
  } else {
    pm = "";
  }

  int ipart = n / tt;
  int fpart = (n - ipart * tt) + tt + 5;

  val = pm + intToString(ipart) + "." + intToString(fpart).substr(1, 3);
  return val;
}

string intToString(int n) {
  stringstream ss;
  ss << n;
  return ss.str();
}

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

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

int main(){
  int a, b, c, d, e, f;
  double x, y;

  while(cin >> a >> b >> c >> d >> e >> f){

    x = (double)(c*e-b*f) / (a*e-b*d);
    y = (double)(f-d*x) / e;

    printf("%.3f %.3f\n", x, y);

  }


  return 0;
}

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

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

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

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

		if(x == 0){x = 0;}
		if(y == 0){y = 0;}

		printf("%.3lf %.3lf\n",x,y );
	}
}

C++: #define _CRT_SECURE_NO_WARNINGS
#include<cstdio>

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

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

int main()
{ 
	double x1, x2, y1, y2, z1, z2;
	double x, y;
	while (cin >> x1 >> y1 >> z1 >> x2 >> y2 >> z2) {
		x = x1;
		x1 *= x2; y1 *= x2; z1 *= x2;
		x2 *= x; y2 *= x; z2 *= x;
		y = (z1 - z2) / (y1 - y2);
		if (z1 - z2 == 0)y = 0;
		x = (z1 - (y1*y)) / x1;
		if (z1 - (y1*y) == 0)x = 0;
		int a, b;
		a = x * 10000;
		b = y * 10000;
		if (a % 10 > 4) {
			a += 10;
			x = double(a) / 10000;
		}
		if (b % 10 > 4) {
			b += 100;
			y = double(b) / 10000;
		}
		cout << fixed;
		cout << setprecision(3) << x << ' ' << y << endl;

	}
	return 0;
}

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

int main(){
	
	double x,y,a,b,c,d,e,f;
	while(std::cin >> a >> b >> c >> d >> e >> f){
	y = (d*c - a*f)/(d*b - a*e);
	x = (c - b*y)/a;
	std::printf("%6.3f %6.3f", x, y);
	}
	
	return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
using namespace std;

#define FOR(i,a,b) for(long long int i=(a);i<(b);i++)
#define REP(i,n) for(long long int i=0;i<(n);i++)
#define ALL(s) (s).begin(),(s).end()

#define PI 3.14159265358479

typedef long long int ll;
typedef vector<long long int> vi;

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

C++: #include <cstdio>

using namespace std;

int main() {
	while(true) {
		int a,b,c,d,e,f;
		if(scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f)<6)break;
		// adx + bdy = cd
		// adx + aey = af
		// (bd-ae)y = cd-af
		int y = (c*d-a*f)*2000/(b*d-a*e);
		// aex + bey = ce
		// bdx + bey = bf
		// (ae-bd)x = ce-bf
		int x = (c*e-b*f)*2000/(a*e-b*d);
		if(x >= 0) {
			x = (x+1)/2;
			printf("%d.%03d ",x/1000, x%1000);
		} else {
			x = (-x+1)/2;
			printf("-%d.%03d ",x/1000, x%1000);
		}
		if(y >= 0) {
			y = (y+1)/2;
			printf("%d.%03d\n",y/1000, y%1000);
		} else {
			y = (-y+1)/2;
			printf("-%d.%03d\n",y/1000, y%1000);
		}
	}
	return 0;
}

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

using namespace std;

double round(double d){
	int k = (int)(d*10000)%10;
	return (k>=5)? d-((double)k/10000)+0.001: d- ((double)k/10000);
}

int main(){
	int a, b, c, d, e, f;
	while(cin >> a >> b >> c >> d >> e >> f){
		double del = 1.0/(a*e - d*b);
		printf("%0.3f %0.3f\n", round(del*(e*c-b*f)), round(del*(a*f-d*c)));
	}
}

C++: #include <bits/stdc++.h>
#include <iostream>
#include <cstdio>
using namespace std;
#define j bai;
int main() {
	double a, b, c, d, e, y, x, f, bai;
	bool bo = false;
	while (cin >> a >> b >> c >> d >> e >> f) {
		if (a ==0 || b ==0) {
			if (a) {
				y = c / b;
				x = f / d - e*y;
			}
			else if (b) {
				x = a / c;
				y = f / e - d*x;
			}
			bo = true;
		}
		else if (d == 0 || e == 0) {
			if (d) {
				y = f / e;
				x = c / a - d*y;
			}
			else if (e) {
				x = f / d;
				y = f / e - d*x;
			}
			bo = true;
		}
		
		else if (a < d) {
			bai = d / a;
			a *= j;
			b *= j;
			c *= j;
		}
		else {
			bai = a / d;
			d *= j;
			e *= j;
			f *= j;
		}
		if (((a > 0 && d < 0) || (a < 0 && d>0)) && bo==false) {
			y = (c + f) / (b + e);
			x = (c - b*y) / a;
		}
		else if (bo == false) {
			y = (c - f) / (b - e);
			x = (c - b*y) / a;
		}
		if (x == -0.000) {
			x = abs(x);
		}
		if (y == -0.000) {
			y = abs(y);
		}
		printf("%.3f %.3f\n", x, y);
	}
	return 0;
}

C++: require("fs").readFileSync("/dev/stdin","utf8").trim().split('\n').map(function(z){i=z.split(' ');console.log(x=((i[2]*i[4]-i[1]*i[5])/(i[0]*i[4]-i[1]*i[3])).toFixed(3),((i[2]-i[0]*x)/i[1]).toFixed(3))})