Go: package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Split(bufio.ScanWords)
	for {
		data := nextInts(6)
		if data[0] == 0 || data[1] == 0 || data[2] == 0 || data[3] == 0 || data[4] == 0 || data[5] == 0 {
			break
		}
		fmt.Printf("%.3f\n", Round(GetX(data[0], data[1], data[2], data[3], data[4], data[5]), 3))
		fmt.Printf("%.3f\n", Round(GetY(data[0], data[1], data[2], data[3], data[4], data[5]), 3))
	}
}

func GetX(a, b, c, d, e, f float64) float64 {
	return ((c * e) - (b * f)) / ((a * e) - (b * d))
}

func GetY(a, b, c, d, e, f float64) float64 {
	return ((c * d) - (a * f)) / ((b * d) - (a * e))
}

func Round(f float64, places int) float64 {
	shift := math.Pow(10, float64(places))
	return math.Floor(f*shift+.5) / shift
}

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() float64 {
	a, _ := strconv.Atoi(next())
	return float64(a)
}

func nextInts(n int) []float64 {
	a := make([]float64, n)
	for i := 0; i < n; i++ {
		a[i] = nextInt()
	}
	return a
}

C++: #include<iostream>
using namespace std;
int main(){
	double a[60000]={0};
	int i=0;
	while(cin>>a[i++]);
	int n=i-1;
	for(int j=0;j<n;j+=6){
		double x=0,y=0;
		if(a[j+3]!=0&&a[j]!=0){
			double k=a[j]/a[j+3];
			a[j+3]*=k,a[j+4]*=k,a[j+5]*=k;
			y=(a[j+2]-a[j+5])/(a[j+1]-a[j+4]);
			x=(a[j+2]-a[j+1]*y)/a[j];
		}else if(a[j]==0){
			x=a[j+5]/a[j+3];
			y=a[j+2]/a[j+1];
		}else if(a[j+3]==0){
			x=a[j+2]/a[j];
			y=a[j+5]/a[j+4];
		}
		cout<<x<<" "<<y<<endl;
	}
	return 0;
}

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

const double EPS=1e-6;

int main() {
	double a,b,c,d,e,f;
	double 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);
		if(x>-EPS)x=abs(x);
		if(y>-EPS)y=abs(y);
		cout<<fixed<<setprecision(3)<<x<<" "<<y<<endl;
	}
	return 0;
}

C++: #include <cmath>
#include <ctime>
#include <algorithm>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <list>
#include <deque>
#include <stack>
#include <bitset>
#include <functional>
#include <numeric>
#include <utility>
#include <iomanip>
#include <cstdio>
#include <cctype>
#include <queue>
#include <complex>
#include <climits>

typedef long long ll;

using namespace std;

int main(void){
	while(1){
		int a,b,c,d,e,f;
		if(cin >> a == 0) break;
		cin >> b >> c >> d >> e >> f;
		double x, y;
		x = (double)(e*c-b*f)/(a*e-b*d);
		y = (double)(a*f-c*d)/(a*e-b*d);

		if(0.0005 > x && x > -0.0005) x = 0.0;
		if(0.0005 > y && y > -0.0005) y = 0.0;

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

	return 0;
}

C++: #include <cstdio>

using namespace std;

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

    return 0;
}

C++: #include <stdio.h>

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

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

int main(){

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

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

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