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 := cF / bE
		x := (c - (y * b)) / a

		fmt.Printf("%d.000 ", x)
		fmt.Printf("%d.000\n", y)
	}
}

C++: #include<iostream>
int main(){for(float a,b,c,d,e,f,x,y,g,h;;printf("%.3f %.3f\n",x,y)){std::cin>>a>>b>>c>>d>>e>>f;if(std::cin.eof())break;g=b*d-a*e;h=c*d-a*f;d*g?(x=f/d-e*h/g/d,y=b?c/b-a*x/b:f/e-d*x/e):(y=h/g,x=a?c/a-b*y/a:f/d-e*y/d);}}

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

int main()
{
    while (true) {
        int a, b, c, d, e, f;
        std::cin >> a >> b >> c >> d >> e >> f;
        if (std::cin.eof()) break;
        double denom = a * e - b * d;
        double x = (c * e - b * f) / denom, y = (a * f - c * d) / denom;
        std::cout << std::fixed << std::setprecision(3) << floor(1000.0 * x + 0.5) / 1000.0
            << " " << floor(1000.0 * y + 0.5) / 1000.0 << std::endl;
    }
}

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) == 6) {
		double det = a*e - b*d;
		double x = (e*c - b*f) / det;
		double y = (-d*c + a*f) / det;
		printf("%.3f %.3f\n", x, y);
	}
	return 0;
}

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

using namespace std;
float a,b,c,d,e,f;
float findoutx,findouty;
float x,y,yadd;
float Timers1,Timers2;
int main()
{
    while(cin >> a >> b >> c >> d >> e >> f)
    {
    Timers1 = a;
    Timers2 = d;
    a=a*Timers2;
    b=b*Timers2;
    c=c*Timers2;
    d=d*Timers1;
    e=e*Timers1;
    f=f*Timers1;

    findouty=b-e;
    yadd = c-f;
    findouty = yadd/findouty;
    b = b*findouty;
    findoutx=(c-b)/a;



    cout<<fixed<<setprecision(3)<<findoutx << " "<<findouty<<endl;  
    }

return 0;
}

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

using namespace std;

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

    return 0;
}

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

int main(){
	while(1){
		double a, b, c, d, e, f, x=0, y=0; // ???????°???°?????°??? %f
		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,y);
	}
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <cassert>
#include <iomanip>

#define EPS (1e-6)

void solveSimultaneousEquation(double a, double b, double c, double d, double e, double f, 
                               std::pair<double, double>* pResult)
{
  assert(b * d - a * e != 0);
  std::pair<double, double>& result = *pResult;

  result.first = (b * f - c * e) / (b * d - a * e);
  result.second = (c * d - a * f) / (b * d - a * e);

  if (fabs(result.first) < EPS) {
    result.first = 0.0;
  }
  if (fabs(result.second) < EPS) {
    result.first = 0.0;
  }
}

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

  while (std::cin >> a >> b >> c >> d >> e >> f) {
    std::pair<double, double> result;
    solveSimultaneousEquation(a, b, c, d, e, f, &result);
    std::cout << std::fixed << std::setprecision(3) << result.first << " " << result.second << std::endl;
  }

  return 0;
}

C++: #include <iostream>
#include <stdio.h>
using namespace std;
int main(){
    double a,b,c,d,e,f;
    while(cin >>a>>b>>c>>d>>e>>f){
        double x = (e*c-b*f)/(a*e-b*d);
        double y = (-(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<iostream>
#include<cstdio>
#include<cmath>
using namespace std;


double a,b,c,d,e,f;
double A,B;//x,y座標
int main(){
  while(scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f) !=EOF){
    
    if(a*e-b*d != 0){
    B =(c*e-f*b)/(a*e-b*d);
    A =(f -a*B)/b;
    }
    
    if(A > 0){
    A =round((A+0.0005)*1000)/1000;
    }else if(A < 0){
    A =round((A-0.0005)*1000)/1000;
    }
    if(B > 0){//小数第4位を四捨五入
    B =round((B+0.0005)*1000)/1000;
    }else if(B <0){
    B =round((B-0.0005)*1000)/1000;
    }
    printf("%.3f %.3f\n",B,A);
  }
  return 0;
}

C++: /* ?°???°????????? */
#include <iostream>
#include <cmath>
#include <string>
using namespace std;

int main(){
	float x, y;
	int a, b, c, d, e, f, xx, yy;
	string p, q;
	while (true){
		cin >> a >> b >> c >> d >> e >> f;
		if (cin.eof()){
			break;
		}
		if (a == 0){
			y = c / b;
			x = (f - e * y) / d;
		}
		else if (b == 0){
			x = c / a;
			y = (f - d * x) / e;
		}
		else if(d == 0){
			y = f / e;
			x = (c - b * y) / a;
		}
		else if(e==0){
			x = f / d;
			y = (c - a * x) / b;
		}
		else{
			x = (c*e - b*f) / (e*a - b*d);
			y = (c - a*x) / b;
		}
		xx = x / 1;
		yy = y / 1;
		p = to_string(xx);
		q = to_string(yy);
		p += ".";
		q += ".";
		b = x * 10;
		c = y * 10;
		for (int i = 1;i<4;i++){
			p += to_string((b*10) % 10);
			q += to_string((c*10) % 10);
			x = x * 10;
			y = y * 10;
			b = x;
			c = y;
		}
		cout << p << " " << q << endl;
	}
	return 0;
}

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

using namespace std;

int main() {

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

	cout << fixed << setprecision(3) << ((c*e-b*f)/(a*e-b*d))  << " " << ((a*f-c*d)/(a*e-b*d)) << endl;
	
	}

	return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <numeric>
#include <string>
#include <vector>
#include <list>
#include <iterator>

#include <cmath>

#define DIM 2
#define EPS (5*10e-4)

typedef std::vector<double> Vec;
typedef std::vector<Vec> Mat;
typedef std::pair<Mat,Vec> Eq;

void removeMinusZero(double& x){
	if ( fabs(x)< EPS ){
		x = 0.0;
	}
}

int main(void){
	using namespace std;
	cout << fixed << setprecision(3);

	list<Eq> input;
	double a,b,c,d,e,f;

	while(cin >> a >> b >> c >> d >> e >> f){
		Vec m1, m2;
		m1.push_back(a);
		m1.push_back(b);
		m2.push_back(d);
		m2.push_back(e);

		Vec vec;
		vec.push_back(c);
		vec.push_back(f);

		Mat mat;
		mat.push_back(m1);
		mat.push_back(m2);

		Eq eq = make_pair(mat,vec);

		input.push_back(eq);
	}

	for(auto itr = input.begin(); itr!=input.end(); ++itr){
		auto mat = itr->first;
		auto vec = itr->second;

		auto det = mat[0][0] * mat[1][1] - mat[0][1] * mat[1][0];

		mat[0][1] = -mat[0][1];
		mat[1][0] = -mat[1][0];
		swap(mat[0][0],mat[1][1]);

		Vec output(DIM);
		for (int i=0; i<DIM; i++){
			output[i] = inner_product(vec.begin(), vec.end(), mat[i].begin(), 0);
		}
		transform(output.begin(), output.end(),output.begin(), std::bind2nd(divides<double>(),det));
		for_each(output.begin(), output.end(), [](double& x) -> void { if(abs(x)< EPS){ x=0.0; } });
		cout << output[0] << " " << output[1] << endl;
	}
}