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<iomanip>
#include<algorithm>
#include<vector>
using namespace std;

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

	return 0;
}

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

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

C++: #include <stdio.h>

int main(){
	int a,b,c,d,e,f;
	double x,y;
	while(scanf("%d%d%d%d%d%d", &a, &b, &c, &d, &e, &f) != EOF){
		x = (e*c-b*f)/(e*a-b*d);
		y = (d*c-a*f)/(b*d-a*e);

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

C++: #include<iostream>
#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)) != -1) {
    double x, y;
    double denom = a * e - b *d;
    double nomer_x = c*e - b*f;
    double nomer_y = -c*d + a*f;
    x = nomer_x / denom;
    y = nomer_y / denom;

    if(x == 0) { x = 0;  }
    if(y == 0) { y = 0;  }

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

  return 0;
}

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

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

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

int main(){
	int i = 0;
	while (i<=1){
		double a, b, c, d, e, f;
		cin >> a >> b >> c >> d >> e >> f;

		double x = (c*e - f*b) / (a*e - b*d);
		cout << fixed << setprecision(3)<< x << " "<< setprecision(3)<< (c - a*x) / b;
		i++;
	}

	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 x = (c*e - b*f) / (a*e - b*d);
		double y = (c*d - a*f) / (b*d - a*e);
		cout << fixed << setprecision(3) << x << " " << y << endl;
	}
}

C++: #include <stdio.h>


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

    while (scanf("%lf %lf %lf %lf %lf %lf", 
    &a, &b, &c, &d, &e, &f)==6){
        x = (e*c-b*f)/(a*e-b*d);
        y = (-d*c+a*f)/(a*e-b*d);
        // round
        tmp = (int)(x*1000) % 10;
        if (x<5) x -= tmp/1000;
        if (x>=5) x += (10-tmp)/1000;
        tmp = (int)(y*1000) % 10;
        if (y<5) y -= tmp/1000;
        if (y>=5) y += (10-tmp)/1000;
        // output
        printf("%.3f %.3f\n", x, y);
    }
    return 0;
}

C++: #include <stdio.h>
double round3(double a){
	a=a*10000;
	if(int(a)%10>5)a=a+10-int(a)%10;
	a=double (int (a/10));
	a=a/10000;
	return a;
}

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

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

using namespace std;

int main(int argc, char *argv[]) {
  double a, b, c, d, e, f;
  vector<double> xy;

  while (true) {
    cin >> a >> b >> c >> d >> e >> f;
    if (cin.eof())
      break;
    a -= d * b / e;
    c -= f * b / e;
    double x = c / a;
    x = (int)(x * 100 + 0.5);
    x /= 100;
    double y = (f - d * x) / e;
    y = (int)(y * 100 + 0.5);
    y /= 100;
    xy.push_back(x);
    xy.push_back(y);
  }

  for (int i = 0; i < xy.size() / 2; i++)
    printf("%.3lf %.3lf\n", xy[i*2], xy[i*2+1]);
  return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <string>
#include <math.h>
#include <algorithm>
using namespace std;
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 - d*c) / (e*a - b*d);

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

 return 0; 
}

C++: #include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
#define loop(i,x,n) for(int i=(x);i<(n);i++)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define mp make_pair
#define fir first
#define sec second
#define ub upper_bound
#define lb lower_bound
#define int long long
using namespace std;
const int MOD=1000000007;
const int INF=1000000009;

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

C++: #include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;
int main(void){
	long long a, b, c, d, e, f;
	long long p, q, r;
	long long x, y, z;
	for (; scanf("%lld %lld %lld %lld %lld %lld", &a, &b, &c, &d, &e, &f) !=EOF;){
		c = c * 1000;
		f = f * 1000;
		p = (a*e) - (d*b);
		q = (c*e) - (f*b);
		x = q / p;
		p = (b*d) - (e*a);
		q = (c*d) - (f*a);
		y = q / p;
		printf("%lld.", x / 1000);
		printf("%03lld\n", x % 1000);
		printf("%lld.", y / 1000);
		printf("%03lld\n", y % 1000);
	}

		return 0;
	}

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

#define EPS (1e-10)

using namespace std;
//?
int main(void){
	double a,b,c,d,p,q;
	while(cin >> a >> b >> p >> c >> d >> q){
		double delta = a*d-b*c;
		double x,y;
		x = (d*p-b*q)/delta;
		y = (-c*p+a*q)/delta;
		printf("%.3f %.3f\n",x+EPS,y+EPS);
	}
	return 0;
}

C++: #include <iostream>
#include <math.h>
#include <cstdio>

using namespace std;

int fugo(double r) {
	return r < 0 ? -1 : 1;
}
double Abs(double r) {
	return r < 0 ? -r : r;
}

int main() {
	char s[1000];
	while (1) {
		string str;
		if ( !getline(cin, str) ) break;

		for (int i = 0; i < str.size(); ++i)
			s[i] = str[i];
		s[str.size()] = '\0';

		double a, b, c, d, e, f;
		sscanf(s, "%lf%lf%lf%lf%lf%lf", &a, &b, &c, &d, &e, &f);

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

		x = fugo(x) * (int)(Abs(x) * 10000 + 5) / 10 / 1000.0;
		y = fugo(y) * (int)(Abs(y) * 10000 + 5) / 10 / 1000.0;

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

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", x, y);
	}
	return 0;
}