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>
#include <vector>
#include <list>
#include <algorithm>
#include <cmath>
#include <stack>
#include <set>
using namespace std;

#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define FOR(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define PUSH(n,v) for(int i=0; i<(n); i++) {int j; cin >> j; v.push_back(j);}
#define ALL(v) v.begin(), v.end()

typedef pair<double, double> XY;

XY solve(double a, double b, double c, double d, double e, double f) {
    double x, y;
    x = (c*e - b*f)/(a*e - b*d);
    y = (a*f - c*d)/(a*e - b*d);
    return make_pair(x,y);
}

int main() {
    double a,b,c,d,e,f;
    while(cin >> a >> b >> c >> d >> e >> f) {
        double x, y;
        XY xy = solve(a,b,c,d,e,f);
        x = xy.first;
        y = xy.second;
        printf("%.3f %.3f\n", round(1000 * x)/1000. + 0.00001, round(1000 * y)/1000. + 0.00001);
    }
    return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef complex<double> P;
typedef pair<int,int> pii;
#define REP(i,n) for(ll i=0;i<n;++i)
#define REPR(i,n) for(ll i=1;i<n;++i)
#define FOR(i,a,b) for(ll i=a;i<b;++i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define MOD (ll)(1e9+7)
#define ADD(a,b) a=((a)+(b))%MOD
#define FIX(a) ((a)%MOD+MOD)%MOD

int main(){
  double a,b,c,d,e,f;
  while(~scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f)){
    // ax+by=c
    // dx+ey=f
    double x,y;
    if(abs(b)<1e-9){
      x = c/a;
      y = (f-d*x)/e;
    }else{
      x = (b*f-c*e)/(b*d-a*e);
      y = (f-d*x)/e;
    }
    if(abs(x)<1e-9) x = abs(x);
    x = round(x*1000.0)/1000.0;
    y = round(y*1000.0)/1000.0;
    printf("%.3f %.3f\n",x,y);
  }
  return 0;
}

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



  return 0;
}

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

#define MAX 256

int main(void){

	double a, b, c, d, e, f;
	double ansx[MAX], ansy[MAX];

	int i = 0;

	while (scanf("%lf%lf%lf%lf%lf%lf%lf", &a,&b,&c,&d,&e,&f) != EOF){
		ansx[i] = (c*e - b*f) / (a*e - b*d);
		ansy[i] = (c*d - a*f) / (b*d - a*e);
		i++;
	}

	for (int j = 0; j < i; j++){
		printf("%.3lf %.3lf\n", ansx[j], ansy[j]);
	}

	return 0;
}

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

int main()
{
	double a,b,c,d,e,f;
		
	while (cin>>a>>b>>c>>d>>e>>f)
	{
		double y=(c-((a/d)*f))/(b-((a/d)*e));
		double x=((c)-(b*y))/(a);
		cout<<setprecision(3) << fixed<<x<<" "<<setprecision(3) << fixed<<y<<endl;
	}
}

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

int det(int a00, int a01, int a10, int a11)
{
	return a00*a11 - a01*a10;
}

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

C++: #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>

using namespace std;


#define all(c) ((c).begin()), ((c).end())
#define debug(c) cerr << "> " << #c << " = " << (c) << endl;
#define iter(c) __typeof((c).begin())
#define tr(i, c) for (iter(c) i = (c).begin(); i != (c).end(); i++)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, a, b) for (int i = (int)(a); i <= (int)(b); i++)

#define mp make_pair
#define fst first
#define snd second
#define pb push_back


const double EPS = 1e-10;


typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef complex<double> P;


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

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

using namespace std;

pair<double, double> solve(int a, int b, int c, int d, int e, int f){
  double pre = b * d - a * e;
  int pre_x = f * b - c * e;
  int pre_y = c * d - a * f;
  pair<double, double> ans;
  
  ans.first = pre_x == 0 ? 0.0 : pre_x / pre;
  ans.second =  pre_y == 0 ? 0.0 : pre_y / pre;

  return ans;
}

int main(){
  int a, b, c, d, e, f;
  vector< pair<double, double> > ans;

  while(cin >> a && cin >> b && cin >> c && cin >> d &&	cin >> e && cin >> f) ans.push_back(solve(a, b, c, d, e, f)); 

  for(int i = 0; i < (int)ans.size(); i++) printf("%.3f %.3f\n", ans[i].first, ans[i].second);
  
  return 0;
}

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

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

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

    f /= e;
    c -= b*f;
    c /= a;

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

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", floor(x * 1000.0) / 1000.0, floor(y * 1000.0) / 1000.0);
  }
  return 0;
}

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

int main(){
    int a,b,c,d,e,f;
    while (cin>>a>>b>>c>>d>>e>>f) {
        double y = (a*f - c*d)/(a*e - b*d);
        double x = (c - b * y)/a;
        int tmp = (x + 0.0005)*1000;
        x = tmp / 1000;
        tmp = (y + 0.0005) * 1000;
        y = tmp / 1000;
        cout<<x<<" "<<y<<endl;
    }
    return 0;
}

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

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