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>
#include <cstdio>
#define eps 1e-10
using namespace std;


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 ya = d * c - a * f;
        double yb = b * d - a * e;
        if(yb == 0) yb += eps;
        double y = ((ya) / (yb));
        if(a == 0) a += eps;
        double x = ((c - b * y) / a);
        printf("%.3f %.3f",x, y);
    }
    
    return(0);
}

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

C++: #include <iostream>

using namespace std;

int main(){
	
	double a[6];

	for(int i=0; i<6; i++){
		cin >> a[i];
	}

	double x,y;

	y=(a[2]/a[0]-a[5]/a[3])/(a[1]/a[0]-a[4]/a[3]);

	x = a[2]/a[0] - a[1]/a[0] * y;

	
	double diff = 0.5;

	x<0?(diff=-0.5):(diff=0.5);
	x = (int)(x*1000+diff);
	
	y<0?(diff=-0.5):(diff=0.5); 
	y = (int)(y*1000+diff); 
	

	x /= 1000;y/=1000;
	

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

C++: #include <stdio.h>

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

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

C++: #include <iostream>
#include <iomanip>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>
#include <cfloat>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <algorithm>
#include <functional>
#include <utility>
#include <numeric>

using namespace std;

typedef unsigned int UI;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int,int> PII;
typedef istringstream ISS;
typedef ostringstream OSS;

#define REP( i, m, n ) for ( int i = (int)( m ); i < (int)( n ); ++i )
#define EACH( v, c ) for ( auto &v : c )

#define ITER( c ) __typeof( (c).begin() )
#define IREP( c, it ) for ( ITER(c) it = c.begin(); it != c.end(); ++it )
#define ALL( c ) (c).begin(), (c).end()

#define PB( n ) push_back( n )
#define MP( a, b ) make_pair( ( a ), ( b ) )
#define EXIST( c, e ) ( (c).find( e ) != (c).end() )

#define fst first
#define snd second

#define DUMP( x ) cerr << #x << " = " << ( x ) << endl
#define DEBUG( x ) cerr << __FILE__ << ":" << __LINE__ << ": " << #x << " = " << ( x ) << endl

typedef vector<double> VD;
typedef vector< VD > VVD;

VD solve( VVD matrix )
{
	REP( i, 0, matrix.size() )
	{
		double a = matrix[i][i];

		REP( j, 0, matrix[i].size() )
		{
			matrix[i][j] /= a;
		}

		REP( j, 0, matrix.size() )
		{
			if ( i == j )
			{
				continue;
			}

			double b = matrix[j][i];

			REP( k, 0, matrix[j].size() )
			{
				matrix[j][k] -= b * matrix[i][k];
			}
		}
	}

	VD res;

	transform( ALL( matrix ), back_inserter( res ), []( VD m ){ return m.back(); } );

	return res;
}

int main()
{
	cin.tie( 0 );
	ios::sync_with_stdio( false );

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

	cout.precision( 3 );
	cout << fixed;

	while ( cin >> a >> b >> c >> d >> e >> f )
	{
		VVD matrix { { a, b, c }, { d, e, f } };

		auto res = solve( matrix );

		cout << res[0] << ' ' << res[1] << endl;
	}

	return 0;
}

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

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

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

int main()
{
	double a,b,c,d,e,f;
	while(true){
		cin >> a;
		if(cin.eof())
			break;
		cin >> b >> c >> d >> e >> f;
		int sum = a;
		a = a*d;
		b = b*d;
		c = c*d;
		d = d*sum;
		e = e*sum;
		f = f*sum;
		double x=0.0,y=0.0;
		y = (c-f)/(b-e);
		if(y==-0.0)
			y=0;
		x = (c-b*y)/a;
		if(x==-0.0)
			x=0;
		cout.precision(3);
		cout << fixed <<x << ' ' ;
		cout.precision(3);
		cout << fixed << y << endl;

	}
	return 0;
}

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

C++: #include <iostream>
#include <iomanip>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <functional>

using namespace std;

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int,int> PII;
typedef long long ll;
typedef unsigned long long ull;

#define REP( i, m, n ) for ( int i = (int)( m ); i < (int)( n ); i++ )
#define UREP( i, m, n ) for ( unsigned int i = (unsigned int)( m ); i < (unsigned int)( n ); i++ )

#define ITER( c ) __typeof( (c).begin() )
#define IREP( c, it ) for ( ITER(c) it = c.begin(); it != c.end(); ++it )
#define ALL( c ) (c).begin(), (c).end()
#define RALL( c ) (c).rbegin(), (c).rend()

#define PB( n ) push_back( n )
#define MP( a, b ) make_pair( ( a ), ( b ) )
#define EXIST( c, e ) ( (c).find( e ) != (c).end() )

#define fst first
#define snd second

#define DUMP( x ) cerr << #x << " = " << ( x ) << endl
#define DEBUG( x ) cerr << __FILE__ << ":" << __LINE__ << ": " << #x << " = " << ( x ) << endl

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

	while ( cin >> a >> b >> c >> d >> e >> f )
	{
		if ( a != 1 )
		{
			b /= a;
			c /= a;
			a = 1;
		}

		if ( d != 0 )
		{
			e -= d * b;
			f -= d * c;
			d = 0;
		}

		if ( e != 1 )
		{
			f /= e;
			e = 1;
		}

		if ( b != 0 )
		{
			c -= b * f;
			b = 0;
		}

		cout.precision( 4 );
		cout << setiosflags	( ios::showpoint ) << c << ' ' << f << endl;
	}

	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
using namespace std;
const double eps = 1e-8;

bool equals(double a, double b) {
  return abs(a-b) < eps;
}

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