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)
		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<bits/stdc++.h>
using namespace std;
int main()
{
    float a,b,c,d,e,f;

    while(cin>>a>>b>>c>>d>>e>>f)
    {
        float x1=c*e-b*f;
        float y1=a*f-c*d;
        float z1=a*e-b*d;

        float x,y;

        if(a==0 && d==0) x=0;

        else x=x1/z1;

        if(b==0 && e==0) y=0;

        else y=(c-a*x)/b;

        if(x==-0.00) x=0.00;

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

    return 0;
}

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

using namespace std;

double EPS = 1e-4;

int gcd(int a, int b) { return b != 0 ? gcd(b, a%b) : a; }

int main() {
	double a, b, c, d, e, f;
	
	while (cin >> a >> b >> c >> d >> e >> f) {
		double x, y;
		
		int div1 = gcd(a, b), div2 = gcd(b, d);
		int div = gcd(div1, div2);
		a /= div; b /= div; c /= div;
		
		div1 = gcd(d, e); div2 = gcd(e, f);
		div = gcd(div1, div2);
		d /= div; e /= div; f /= div;
		
		double s = a*f/d, s_ = a*e/d;
		if (fabs(s) < EPS) s = 0.0;
		if (fabs(s_) < EPS) s_ = 0.0;
		
		y = (c - s)/(b - s_);
		if (fabs(y) < EPS) y = 0.0;
		
		x = (c - b*y)/a;
		if (fabs(x) < EPS) x = 0.0;
		
		printf("%.3lf %.3lf\n", x, y);
	}
	
	return 0;
}

C++: #include <iostream>
using namespace std;
int main()
{
    double a,b,c,d,e,f;
    double x,y;
    while(cin >> a >> b >> c >> d >> e >> f){
        x = (e*c - b*f) / (a*e - d*b);
        y = (a*f - c*d) / (a*e - d*b);
        if(x == -0){
            x = 0;
        }
        if(y == -0){
            y = 0;
        }
        printf("%.3lf %.3lf\n", x, y);
    }
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <set>
#include <vector>
#include <cstring>
#include <climits>
#include <queue>
using namespace std;

#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define EPS 1e-6

int main(){
	int a,b,c,d,e,f;
	while(~scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f)){
		int p = c*e - b*f;
		int q = a*e - b*d;
		double x,y;
		
		//printf("p:%d  , q:%d\n",p,q);
		if( q!=0 ){
			x = (double)abs(p) / (double)abs(q);
			if( p<0&&q>0 || p>0&&q<0 ) x *= -1;
		}else{
			x = 0.0;
		}
		if( e!=0 ){
			double k;
			int sign;
			if( f-d*x + EPS < 0 ){
				k = d*x - f;
				sign = e<0 ? 1 : -1;
				
			}else{
				k = f - d*x;
				sign = e<0 ? -1 : 1;
			}
			y = (double)k / (double)abs(e);
			y *= (double)sign;
		}else{
			y = 0.0;
		}
		printf("%.3lf %.3lf\n",x,y);
	}
	return 0;
}

C++: #include <iostream>
#include <math.h>
using namespace std;
int main() {
	int i;
	double a[2], b[2], c[2], x, y;
	cin >> a[0] >> b[0] >> c[0] >> a[1] >> b[1] >> c[1];
	if (a[0] == 0) {
		y = c[0] / b[0];
		x = (c[1] - b[1] * y) / a[1];
	}
	else if (b[0] == 0) {
		x = c[0] / a[0];
		y = (c[1] - a[1] * x) / b[1];
	}
	else if (a[1] == 0) {
		y = c[1] / b[1];
		x = (c[0] - b[0] * y) / a[0];
	}
	else if (b[1] == 0) {
		x = c[1] / a[1];
		y = (c[0] - a[0] * x) / b[0];
	}
	else {
		x = (c[1] - c[0] * b[1] / b[0]) / (a[1] - a[0] * b[1] / b[0]);
		y = (c[0] - a[0] * x) / b[0];
	}
	x = x * 1000;
	x = round(x);
	x = x / 1000;
	y = y * 1000;
	y = round(y);
	y = y / 1000;
	cout << x << endl << y << endl;
	return 0;
}

C++: #include <stdio.h>
#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

int main() {

int a,b,c,d,e,f,x,y;

	while(cin >> a >> b >> c >> d >> e >> f) {
	
	 float y =(float)(a*f - c*d)/(a*e - b*d);
	 float x =(float)(c*e - b*f)/(a*e - b*d);

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

    return 0;
}

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

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

	return 0;
}

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

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

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

using namespace std;


int main(){

    float a,b,c,d,e,f;
    while (scanf("%f%f%f%f%f%f",&a,&b,&c,&d,&e,&f)!=EOF){
        float x,y;
        if (a==0)
            swap(a,d),swap(b,e),swap(c,f);

        float ratio=d/a;

        e-=ratio*b;
        f-=ratio*c;

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

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


    return 0;
}

C++: #include <iostream>
#include <stdio.h>
using namespace std;
int main(){
	int a,b,c,d,e,f;
	while(cin >> a >> b >> c >> d >> e >> f){
		double x,y;
		x = (double) ( c * e - b * f )/(a * e - b * d);
		y = (double) ( a * f - c * d )/(a * e - b * d);
		printf("%.3f %.3f\n",x,y);
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
const double EPS=1E-8;
typedef vector<double> vec;
typedef vector<vec> mat;

vec gauss_jordan(const mat& A,const vec& b){
  int n=A.size();
  mat B(n,vec(n+1));
  for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)B[i][j]=A[i][j];
  for(int i=0;i<n;i++)B[i][n]=b[i];
  for(int i=0;i<n;i++){
    int pivot=i;
    for(int j=i;j<n;j++)
      if(abs(B[j][i])>abs(B[pivot][i]))pivot=j;
    swap(B[i],B[pivot]);
    if(abs(B[i][i])<EPS)return vec();
    for(int j=i+1;j<=n;j++)B[i][j]/=B[i][i];
    for(int j=0;j<n;j++){
      if(i!=j)
	for(int k=i+1;k<=n;k++)B[j][k]-=B[j][i]*B[i][k];
    }
  }
  vec x(n);
  for(int i=0;i<n;i++)x[i]=B[i][n];
  return x;
}

int main(){
  double a,b,c,d,e,f;
  while(cin>>a>>b>>c>>d>>e>>f){
    mat A(2,vec(2));
    vec B(2);
    A[0][0]=a,A[0][1]=b;
    A[1][0]=d,A[1][1]=e;
    B[0]=c,B[1]=f;
    vec r=gauss_jordan(A,B);
    printf("%.3f %.3f\n",r[0],r[1]);
  }
  return 0;
}

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

void func(double, int);

int main(){

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

	return 0;
}

void func(double x, int n){
	
	x *= pow(10, -n-1);
	x = round(x);
	x *= pow(10, n+1);	

}

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

using namespace std;

int main(){
   double a,b,c,d,e,f;
   double x,y;
   int X,Y;
   
   while(cin>>a>>b>>c>>d>>e>>f){
      x = (c*e-b*f)/(a*e-b*d);
      y = (c*d-a*f)/(b*d-a*e);
      
      X = static_cast<int>(x*10000);
      if(X%10>=5){
         X += 10 - (X%10);
         x = static_cast<double>(X /10000);
      }
      Y = static_cast<int>(y*10000);
      if(Y%10>=5){
         Y += 10 - (Y%10);
         y = static_cast<double>(Y /10000);
      }
      if(0 == static_cast<int>(x))
         x = 0;
      if(0 == static_cast<int>(y))
         y = 0;
      
      printf("%.3lf %.3lf\n",x,y);
      
   }
   return 0;
}