Go: package main

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

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]
		var mulA, mulD int
		if a < 0 {
			mulA = a * -1
		} else {
			mulA = a
		}
		if d < 0 {
			mulD = d * -1
		} else {
			mulD = d
		}
		a *= mulD
		b *= mulD
		c *= mulD
		d *= mulA
		e *= mulA
		f *= mulA

		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.Print(x)
		fmt.Print(".000 ")
		fmt.Print(y)
		fmt.Println(".000")
	}
}

C++: #include <cstdio>
#include <stdlib.h>
#include <math.h>

float a,b,c,d,e,f;
double    round( double val, int precision )
{
    double    ret;
    char    buf[256] = {'\0'};
    char    *p;

    sprintf( buf, "%.*f", precision, val );
    ret = strtod( buf, &p );

    return ret;
}
int main (){
  scanf("%f %f %f %f %f %f",&a,&b,&c,&d,&e,&f);
  double x,y;
  x=(f*b/e-c)/(d*b/e-a);
  y=(f*a/d-c)/(e*a/d-b);
 round(x,4);
 round(y,4);
modf(x*1000, &x);
modf(y*1000, &y);
  printf("%.3f %.3f\n",x/1000,y/1000);
}

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

int rnd(double t){
	if(t>=0.0){
		return (int)(t+0.5);
	}else{
		return (int)(t-0.5);
	}
}
void prnt(double t){
	if(t<0.0){
		cout<<"-";
		t*=-1;
	}
	cout<<(int)t<<"."<<(int)(t*10)-(int)t*10<<(int)(t*100)-(int)(t*10)*10<<(int)(t*1000)-(int)(t*100)*10;
}
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=(a*f-c*d)/(a*e-b*d);
		x=rnd(x*1000.0)/1000.0;
		y=rnd(y*1000.0)/1000.0;
		prnt(x);
		cout<<" ";
		prnt(y);
		cout<<endl;
	}
	return 0;
}

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);
    }
}