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.Printf("%d.000 ", x)
		fmt.Printf("%d.000\n", y)
	}
}

C++: #include <math.h>
#include <iostream>
#include <ios>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <string>

#define YES "YES"
#define NO "NO"
#define space ' '

using namespace std;

void func();

int main(void)
{
	
	func();

	return 0;
}

// using matrix	?????????????????´??????
void func()
{
	int a, b, c, d, e, f;
	double x, y;

	while (cin >> a >> b >> c >> d >> e >> f, !cin.eof()){


	//	if ((a*e - d*b) == 0)
		{
		//	cout << 0 << space << 0 << endl;
		}
		else
		{
			x = (e*c - b*f) / (a*e - d*b);
			y = (-d*c + a*f) / (a*e - d*b);

			cout << fixed << setprecision(3);
			cout << x*0.0005 << space << y+0.0005 << endl;
			cout << dec;
		}
	}
}

C++: #include <stdio.h>

int main(void){
	int a, b, c, d, e, f;
	double alpha, beta;
	double x, y;
	double ratio;

	while(scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f) != -1){
		

		ratio = -1 * ((double)d / (double)a);
		alpha = ratio * b;
		beta = ratio * c;
		//printf("%f %f %f\n", ratio, alpha, beta);

		y = (double)(beta + f) / (alpha + e);
		x = (double)(f - e * y) / 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;

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

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 = (c * e - b * f) / (a * e - b * d);
		if (fabs(x) < 1e-4) x = 0.0;
		if (fabs(y) < 1e-4) y = 0.0;
		printf("%.3f %.3f\n", x, y);
	}

	return 0;
}

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);
    if(x<=0&&x>-0.001){
      x=0;
    }
    if(y<=0&&y>-0.001){
      y=0;
    }
    
    printf("%.3f %.3f\n",x,y);
  }
  return 0;
}

C++: #include <stdio.h>

void Renritsu(double a,double b,double c,double d,double e,double f){
	double ta = a * d;
	double tb = b * d;
	double tc = c * d;
	double td = d * a;
	double te = e * a;
	double tf = f * a;
	td -= ta;
	te -= tb;
	tf -= tc;
	double y = tf / te;
	ta = a * e;
	tb = b * e;
	tc = c * e;
	td = d * b;
	te = e * b;
	tf = f * b;
	td -= ta;
	te -= tb;
	tf -= tc;
	double x = tf / td;
	printf("%.3lf %.3lf \n",x,y);
}


void main()
{
	Renritsu(1,2,3,4,5,6);
	Renritsu(2,-1,-2,-1,-1,-5);
}

C++: #include <iostream>
#include <stdio.h>
using namespace std;
int main(void){
    double A[2][3];
    while(cin >> A[0][0] >> A[0][1] >> A[0][2] >> A[1][0] >> A[1][1] >> A[1][2]){
        for(int i = 1; i < 3; i++){
            A[0][i] /= A[0][0];
        }
        A[0][0] /= A[0][0];
        for(int i = 1; i < 3; i++){
            A[1][i] -= A[0][i] * A[1][0];
        }
        A[1][0] -= A[0][0] * A[1][0];
        for(int i = 0; i < 3; i++){
            if(i != 1)
                A[1][i] /= A[1][1];
        }
        A[1][1] /= A[1][1];
        for(int i = 0; i < 3; i++){
            if(i != 1)
                A[0][i] -= A[1][i] * A[0][1];
        }
        A[0][1] -= A[1][1] * A[0][1];
        
        printf("%.3f %.3f\n", A[0][2], A[1][2]);
    }
}

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

/*
??£???????¨????
	ax + by = c
	dx + ey = f
????§£x, y???????????????????????°??????
*/
int main() {
	double a, b, c, d, e, f;
	int cnt = 0;						//??\??????????????£???????¨????????????°
	std::vector<double> x_vector;		//x????§£???????´?
	std::vector<double> y_vector;		//y????§£???????´?

#if 0
	while (cnt < 1) {
		cin >> a >> b >> c >> d >> e >> f;
#else
	while (cin >> a >> b >> c >> d >> e >> f) {
#endif
		if (
			((a < -1000) || (1000 < a)) ||
			((b < -1000) || (1000 < b)) ||
			((c < -1000) || (1000 < c)) ||
			((d < -1000) || (1000 < d)) ||
			((e < -1000) || (1000 < e)) ||
			((a < -1000) || (1000 < f))
			) {
			break;
		}
		double x = (b * f - c * e) / (b * d - a * e);
		double y = (c * d - a * f) / (b * d - a * e);

		cnt++;
		x_vector.push_back(x);
		y_vector.push_back(y);
	}

	for (unsigned int i = 0; i < cnt; i++) {
		std::cout << std::fixed << std::setprecision(3) << x_vector[i] << " ";
		std::cout << std::fixed << std::setprecision(3) << y_vector[i] << endl;
	}

	cnt = 0;
	x_vector.clear();
	y_vector.clear();

	//???????????°
	//while (1);

	return 0;
}

C++: #include<stdio.h>


double shishagonyu(double x){
	if(x > 0){
		x = (int)(x*1000 + 0.5);
	}else if(x < 0){
		x = (int)(x*1000 - 0.5);
	}
	return x/1000;
}


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

	while(scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF){
		double r = b*d - a*e;
		double x = (b*f - c*e)/r;
		double y = (c*d - a*f)/r;
		printf("%0.3f %0.3f\n", x, y);
	}

	return 0;
}

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

int main(void) {
	double a=0,b=0,c=0,d=0,e=0,f=0;
	string rx,ry;
	vector<string> r;
	while (scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f) != EOF){
		double x=0,y=0;
		x = round((b*f-e*c)/(b*d-a*e)*1000+0.0001)/1000.0;
		y = round((a*f-d*c)/(a*e-b*d)*1000+0.0001)/1000.0;
		ostringstream os;
		os.setf(ios::showpoint);
		os << setprecision(4) << x << " " << y;
		r.push_back(os.str());
	}
	for (int i=0;i<r.size();i++)
	{
		cout << r[i] << endl;
	}
	return 0;
}

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

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

	cin >> a >> b >> c >> d >> e >> f;

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

	cout << showpoint << setprecision(3);
	cout << setiosflags( ios::fixed );
	cout << ( x == -0.0 ? 0.0 : x ) << " " << ( y == -0.0 ? 0.0 : y ) << endl;
}

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

C++: #include<stdio.h>
int main(){
    double a,b,c,d,e,f,x,y;
    while(scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f)!=EOF){
        if(a<0){
            a=-a;
            b=-b;
            c=-c;
        }
        if(d<0){
            d=-d;
            e=-e;
            f=-f;
        }
        y=((c*d)-(a*f))/((b*d)-(a*e));
        x=((b*f)-(c*e))/((b*d)-(a*e));
        printf("%.3lf %.3lf\n",x,y);
    }
    return 0;
}