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<stdio.h>

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

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

/*
ax + by = c
dx + ey = f

x = (c-by)/a
d(c-by)/a + ey = f
dc/a - dby/a + ey = f
ey - dby/a = f - dc/a
y(e-db/a) = f - dc/a
y = (f-dc/a)/(e-db/a)

aex + bey = ce
bdx + bey = bf
aex - bdx = ce - bf
x(ae - bd) = ce - bf
x = (ce - bf)/(ae - bd)
by = c - ax
y = (c - ax)/b
*/
int main()
{
    while(true){
        double a, b, c, d, e, f;
        std::cin >> a >> b >> c >> d >> e >> f;
        if(std::cin.eof()) break;
        // double y = (f-d*c/a)/(e-d*b/a);
        // double x = (c-b*y)/a;
        double x = (c*e - b*f) / (a*e - b*d);
        double y = (c - a*x) / b;
        std::cout << std::fixed << std::setprecision(3);
        std::cout << x << " " << y << std::endl;
    }
    return 0;
}

C++: #include<stdio.h>
#define rep(i,m,n) for(i = m;i < n;i++)
int main(){
	int a[6],i;
	int kcor = 0;
	double kx[1000] = {0},ky[1000] = {0};
	while(scanf("%d",a)!=-1){
		rep(i,1,6)
			scanf("%d",a+i);
		int det;
		det = a[0]*a[4]-a[1]*a[3];
		kx[kcor] = (a[4]*a[2]-a[1]*a[5])/det;
		ky[kcor] = (-a[3]*a[2]+a[0]*a[5])/det;
		kcor++;
	}
	rep(i,0,kcor)
		printf("%.3lf %.3lf\n",kx[i],ky[i]);
	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=(c*e-b*f)/(a*e-d*b);
        y=(f*a-c*d)/(e*a-b*d);
        printf("%.3f %.3f\n",x,y);
    }
}

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

int main(){
	double a, b, c, d, e, f;
	scanf("%lf%lf%lf%lf%lf%lf", &a, &b, &c, &d, &e, &f);
	printf("%.3f %.3f", ((c - b * (c * d - a * f) / (b * d - a * e)) / a, (c * d - a * f) / (b * d - a * e)));
	return 0;
}

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

int main()
{
	double a,b,c,d,e,f;
	double x,y;
	int count = 0;
	vector<double> result_x,result_y;

	while(cin >> a >> b >> c >> d >> e >> f) {
		y = (a * f - c * d) / (a * e - b * d);
		if(a==0)
			x = (c - b * y) / a;
		else
			x = (f - e*y) / d;
		result_y.push_back(y);
		result_x.push_back(x);
		printf("%.3f %.3f\n", x,y);
		count++;
	}

	return 0;
}

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

using namespace std;

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

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

C++: #include<stdio.h>

int main(){
	double a,b,c,d,e,f,x,y,x2,y2;
	double aa=1000,bb=1000;
	int status;
	while(1){
		status=scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f);
		if (status==EOF){
			break;
		}
		x=(f/e-c/b)/(d/e-a/b);
		y=c/b-a*x/b;
		x2=(b*f-c*e)/(b*d-a*e);
		y2=(c-a*x2)/b;
		
		if (b==0){
			y2=(f-d*x2)/b;
		}
		
		
		
		if (x2<0.0005 && x2>-0.0005){
			x2=0;
		}
		if (y2<0.0005 && y2>-0.0005){
			y2=0;
		}
	//	printf("%.3f %.3f\n",x,y);
	//	printf("%f %f\n",x,y);
		printf("%.3f %.3f\n",x2,y2);
	//	printf("%f %f\n\n\n",x2,y2);
	}
	
	return 0;
}

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

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

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

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

int main() {
    string line;
    while (getline(cin, line)) {
        int a, b, c, d, e, f;
        stringstream ss(line);
        ss >> a >> b >> c >> d >> e >> f;

        double x = 0.0;
        if (c*e != b*f)
            x = static_cast<double>(c*e - b*f) / (a*e - b*d);
        double y = 0.0;
        if (b != 0) {
            y = static_cast<double>(c - a*x) / b;
        } else {
            y = static_cast<double>(f - d*x) / e;
        }
        cout.setf(ios_base::fixed, ios_base::floatfield);
        cout << std::setprecision(3) << x << " " << y << endl;
    }
}

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

using namespace std;

int main()
{
	int a[1000],b[1000],c[1000],d[1000],e[1000],f[1000];
	float x[1000],y[1000];
	int len=0;
	while (cin >> a[len] >> b[len] >> c[len] >> d[len] >> e[len] >> f[len])
		len++;

	for (int i=0; i < len; i++) {
		x[i] =  (double)((e[i] * c[i] - b[i] * f[i]) / (double)(e[i] * a[i] - b[i] * d[i]));
		y[i] =  ((c[i] * d[i] - f[i] * a[i]) / (b[i] * d[i] - a[i] * e[i]));
	}
	for (int i=0; i < len; i++) {
		printf("%.3lf %.3lf\n",x[i],y[i]);
	}
	return 0;
}

C++: #include <iostream>
#include <array>
#include <vector>
#include <cmath>
#include <iomanip>

using namespace std;

//?????¨?????\
double round_four(double value){
    value *= 1000;
    value += (value / fabs(value)) * 0.5;
    int nValue = static_cast<int>(value);
    value = static_cast<double>(nValue) / 1000;
    return value;
}

//????¬?????¨?????§£
array<double, 2> comp_linear_equation(int a, int b, int c, int d, int e, int f){
    array<double, 2> result;
    result[0] = static_cast<double>(e * c - (f * b));
    result[1] = static_cast<double>(-(d * c) + a * f);
    double num = 1.0 / ((a * e) - (b * d));
    result[0] *= num;
    result[1] *= num;
    result[0] = round_four(result[0]);
    result[1] = round_four(result[1]);
    return result;
}

//?????????
int main(){
    int a, b, c, d, e, f;
    vector<array<double, 2>> result;
    while (cin >> a >> b >> c >> d >> e >> f){
        result.push_back(comp_linear_equation(a, b, c, d, e, f));
    }
    for (const auto& element : result){
        for (auto num : element){
            cout << fixed << setprecision(3) << num << " ";
        }
        cout << endl;
    }
    return 0;
}