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 <bits/stdc++.h>
#include <vector>
using namespace std;
double a, b, c, d, e, f, x, y;
int main(){
	while(cin >> a >> b >> c >> d >> e >> f){
		x = (c*e - b*f)/(e*a - b*d);
		y = (c*d - a*f)/(d*b - a*e);
		if(x == -0)
			x = 0;
		if(y == -0)
			y = 0;
		cout << fixed << setprecision(3) << x << " " << y << "\n";
	}
	return 0;
}

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))
    {
        
        float x=(c*e-b*f)/(a*e-b*f);
        float y=(c*d-a*f)/(b*d-a*e);
        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, x, y;

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

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

		cout << fixed << setprecision(3);
		cout << x << ' ' << y << endl;
		cout << setprecision(6);
	}

	return 0;
}

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

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

C++: #include<iostream>
#include<vector>
#include<cmath>
#include<algorithm>
#include<string>
int gcd(int a, int b) {
	int num;//?????§??¬?´???°
	for (int i = std::min(a, b); i >= 0; --i) {
		if (a%i == 0 && b%i == 0) { num = i; break; }
	}
	return a*b / num;
}
int main() {
	double a, b, c,d,e,f;
	double x, y;
	while (std::cin >> a >> b >> c >> d >> e >> f) {
		y = (c*gcd(a, d) / a - f*gcd(a, d) / d) / (gcd(a, d) / a*b - gcd(a, d) / d*e);
		y *= 1000; y = std::round(y); y /= 1000;
		x = (c - b*y) / a;
		x *= 1000; x = std::round(x); x /= 1000;
		std::cout << x << " " << y << std::endl;
	}
	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=(f-c*e/b)/(d-a*e/b);
		y=(f-c*d/a)/(e-b*d/a);

		cout << fixed << setprecision(3) << x << " " << y << endl;
	}

	return 0;
}

C++: #include<stdio.h>
#include<iostream>
#include<iomanip>

#define REP(i, a) for(int i=0;i<(int)a;++i)
using namespace std;

void solver() {
    double a, b, c, d, e, f;
    while (cin >> a >> b >> c >> d >> e >> f) {
        auto x=(c*e-b*f)/(a*e-b*d);
        auto y=(c-a*x)/b;
        if(x<0.00005) x=0;
        if(y<0.00005) y=0;
        printf("%.3f %.3f\n",x,y);
    }
}

int main() {
    solver();
    return 0;
}

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


double a,b,c,d,e,f;
double x,y;//x,y座標
int main(){
  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 =(c -a*x)/b;
    if(y > 0){
      y =floor((y+0.0005)*1000)/1000;
    }
    if(y < 0){
      y = -1*(floor((fabs(y)+0.0005)*1000)/1000);
    }
    if(x > 0){//小数第4位を四捨五入
      x =floor((x+0.0005)*1000)/1000;
    }
    if(x <0){
      x = -1*(floor((fabs(x)+0.0005)*1000)/1000);
    }
    if(x == 0){x =0.000;}
    if(y == 0){y =0.000;}
    printf("%.3f %.3f\n",x,y);
  }
  return 0;
}

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

using namespace std;

//?????¨?????\
double round_four(double value){
    //0??????
    if (value <= 0.00001 && value >= -0.00001){
        return 0;
    }
    //?????????
    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){
        cout << fixed << setprecision(3) << element[0] << " " << element[1] << endl;
    }
    return 0;
}

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

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

C++: #include<stdio.h>

int main(void)
{
	int a,b,c,d,e,f;
	while(scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f) != EOF){
	
	double y = ((c*d-a*f)/(b*d-a*e));
	double x = ((c-b*y)/a);
	
	printf("%0.3f %0.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<vector>
#include<algorithm>
#include<functional>
#include<iomanip>
using namespace std;
double round3d (double d) {
	return (double)((int)(d * 1000.0 + 0.5 - (d < 0) )) / 1000.0;
}
int main(){
	while (true) {
		double a, b, c, d, e, f;
		cin >> a >> b >> c >> d >> e >> f;
		if (cin.eof()) break;
		double x = (b * f - e * c) / (b * d - a * e);
		double y = (c * d - a * f) / (b * d - a * e);
		cout << setprecision(3) << fixed << round3d(x) << " " << round3d(y) << "\n";
	}
    return 0;
}