Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	var strs []string
	var a, b, c, d, e, f float64
	var x, y float64
	for scanner.Scan() {
		strs = strings.Split(scanner.Text(), " ")
		_a, _ := strconv.Atoi(strs[0])
		_b, _ := strconv.Atoi(strs[1])
		_c, _ := strconv.Atoi(strs[2])
		_d, _ := strconv.Atoi(strs[3])
		_e, _ := strconv.Atoi(strs[4])
		_f, _ := strconv.Atoi(strs[5])
		a = float64(_a)
		b = float64(_b)
		c = float64(_c)
		d = float64(_d)
		e = float64(_e)
		f = float64(_f)
		y = (c*d - f*a) / (d*b - a*e)
		x = (c - b*y) / a

		fmt.Printf("%.3f %.3f\n", x, y)
	}
}

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

#define DIM 2

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

int main(void){
	using namespace std;

	list<Eq> input;

	double a,b,c,d,e,f;

	cout << fixed << setprecision(3);

	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;

		Vec output(DIM);

		auto det = mat[0][0] * mat[1][1] - mat[0][1] * mat[1][0];
		std::transform(vec.begin(), vec.end(),vec.begin(), std::bind1st(multiplies<double>(),1.0/det));

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

		for (int i=0; i<DIM; i++){
			output[i] = inner_product(vec.begin(), vec.end(), mat[i].begin(), 0);
		}

		cout << output[0] << " " << output[1] << endl;
	}

}

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

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

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

	return 0;
}

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

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

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

int main(){
	float x, y;
	int a, b, c, d, e, f, p[4], q[4];
	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;
		}
		cout << 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 * 1000) / 1000, (y * 1000) / 1000);
  }
  return 0;
}

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

using namespace std;

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

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

int main(){
  int i=0,j=0,k=0;
  double mix[1000][8];

  while(cin>>mix[i][j]){
    for(j=1;j<6;j++)
      cin>>mix[i][j];
    i++;
    j=0;
  }

  for(j=0;j<i;j++){
    mix[j][6] = (mix[j][4] * mix[j][2] - mix[j][1] * mix[j][5]) / ( mix[j][0] * mix[j][4] - mix[j][1] * mix[j][3]);
    mix[j][7] = (mix[j][0] * mix[j][5] - mix[j][3] * mix[j][2]) / ( mix[j][0] * mix[j][4] - mix[j][1] * mix[j][3]);
    printf("%.3f %.3f\n",mix[j][6],mix[j][7]);


  }
  return 0;
}

C++: #include <stdio.h>
#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 << a << " " << b << " " << c << " " << d << " " << e << " " << f << endl;
    c /= a;
    b /= a;
    a = 1.0;
    // cout << a << " " << b << " " << c << " " << d << " " << e << " " << f << endl;
    double tmp = d / a;
    // cout << "tmp " << tmp << endl;
    d -= a * tmp;
    e -= b * tmp;
    f -= c * tmp;
    // cout << a << " " << b << " " << c << " " << d << " " << e << " " << f << endl;
    f /= e;
    e = 1.0;
    // cout << a << " " << b << " " << c << " " << d << " " << e << " " << f << endl;
    tmp = b / e;
    // if (b * e >= 0) {
    b -= e * tmp;
    c -= f * tmp;
    /*} else {
      b += e * tmp;
      c += f * tmp;
      }*/
    // cout << a << " " << b << " " << c << " " << d << " " << e << " " << f << endl;
    // cout << setprecision(4) << c << " " << setprecision(4) << f << endl;
    printf("%2.3f %2.3f\n", c, f);
  }
  return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
typedef long long int ll;

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

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

#define N 1024


double func(double x)
{
	x *= 1000;
	x = (double)(int)(x + 0.5);
	x /= 1000;
	return x;
}

int main()
{
	char buff[N];
	
	while (NULL != fgets(buff, N, stdin))
	{
		double a, b, c, d, e, f;
		sscanf(buff, "%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f);
		
		double dd = a * e - b * d;
		double x = ( e * c - b * f ) / dd;
		double y = ( - d * c + a * f ) / dd;
		
//		x = func(x);
//		y = func(y);

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


}

C++: //
//  main.cpp
//  b
//
//  Created by h3037178 on 2017/07/31.
//  Copyright ?? 2017??´ ?????£?????????. All rights reserved.
//

#include <iostream>
#include<algorithm>
#include<math.h>
#include<stdio.h>
using namespace std;
int main(){
    float a,b,c,d,e,f,x,y;
    while(cin>>a>>b>>c>>d>>e>>f){
        x=(c*e-f*b)/(a*e-b*d);
        y=(c*d-f*a)/(b*d-a*e);
        if(x<-0,0005){
            x=0,000;
        }
        if(y<-0.0005){
            y=0.000;
        }

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

C++: #include<stdio.h>

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