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 <cstdio>
#include <math.h>
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("%.3lf %.3lf\n", x, y);
	}
	return 0;
}

C++: #include<stdio.h>
int main(){
	int a,b,c,d,e,f;
	double x,y,z,v;
	while(1){
	scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f);
	x=(double)(c*e-b*f)/(a*e-b*d);
	y=(double)(c*d-a*f)/(b*d-a*e);
	if(x>=-0.0005&&x<0.0005)	x=0;
	if(y>=-0.0005&&y<0.0005)	y=0;
	printf("%.3lf %.3lf\n",x,y);
}
}

C++: #include <iostream>
#include <iomanip>
using namespace std;
int main() {
  int a, b, c, d, e, f;
  while (cin >> a >> b >> c >> d >> e >> f) {
    double det = a*e - b*d;
    double x = (e*c-b*f)/det;
    double y = (-d*c+a*f)/det;

    cout.setf(ios::showpoint);
    cout.precision(4);
    if (x == 0) x = 0;
    if (y == 0) y = 0;
    cout << x << ' ' << y << endl;

  }
  return 0;
}

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

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

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

int main(){
	double a11,a12,c,a21,a22,f;
	while(cin>>a11>>a12>>c>>a21>>a22>>f){
		double x,y,delta=a11*a22-a12*a21;
		x=(a22*c-a12*f)/delta;
		y=(a11*f-c*a21)/delta;
		/*if(x>0){x=(double)(((int)((x*1000)+0.5))/1000);
		}else{x=(double)(((int)((x*1000)-0.5))/1000);}
		if(y>0){y=(double)(((int)((y*1000)+0.5))/1000);
		}else{y=(double)(((int)((y*1000)-0.5))/1000);}*/
		cout<<fixed<<setprecision(3)<<x<<" "<<y<<endl;
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cmath>
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 * f + c * e) / (-b * d + a * e);
    y = (-a * f + c * d) / (-a * e + b * d);
    printf("%.3f %.3f\n", x + 0.0001, y + 0.0001);
  }
  return 0;
}

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

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

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

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

		double x = (c * e + f * -b)/(a*b - d*e);
		double y = (c * -d + f * a)/(a*b - d*e);
		printf("%.3f %.3f\n",x,y);
    }
    return 0;
}

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

int main()
{
	double a,b,c,d,e,f;
	while(cin>>a>>b>>c>>d>>e>>f)
	{
		double x = static_cast<int>((c*e-b*f)/(a*e-b*d)*1000+0.5)*0.001;
		double y = static_cast<int>((c*d-a*f)/(b*d-a*e)*1000+0.5)*0.001;
		cout << x << ' ' << y << '\n';
	}
}

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

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

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

using namespace std;

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

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

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

C++: #include <stdio.h>
#include <math.h>

using namespace std;


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

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

    return 0;
}

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

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

C++: 
#include <cmath>
#include <string>
#include <sstream>
#include <iostream>
#include <algorithm>

int main(void) 
{
    std::string str;
    float a, b, c, d, e, f;
    float x, y;

    while (getline(std::cin, str)) {
        std::istringstream str_s(str);

        str_s >> a >> b >> c >> d >> e >> f;

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

        x = (float)round(x*100)/100;
        y = (float)round(y*100)/100;

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

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

        std::cout.setf(std::ios::fixed);  
        std::cout.precision(3);

        std::cout << std::showpoint << x << ' ' << y << '\n';
    }

    return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
constexpr double EPS = 1e-8;

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 = (c - a * x) / b;
        if (abs(x) < EPS) x = 0;
        if (abs(y) < EPS) y = 0;
        cout << fixed << setprecision(3) << x << " " << y << endl;
    }
    return 0;
}

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

{
	double a,b,c,d,e,f;
	double x,y;
	
	while (cin>>a>>b>>c>>d>>e>>f, cin.eof()) {
		y = (c * d - a * f) / (b * d - e * a);
		x = (c - (b * y)) / a;
		
		cout<<setprecision(3)<<setiosflags(ios::fixed)<<x<<" "<<y<<endl;
	}	
	return 0;
}