Go: package main

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

var sc = bufio.NewScanner(os.Stdin)

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

func main() {
	sc.Split(bufio.ScanLines)
	for sc.Scan() {
		s := strings.Split(sc.Text(), " ")
		a, _ := strconv.ParseFloat(s[0], 64)
		b, _ := strconv.ParseFloat(s[1], 64)
		c, _ := strconv.ParseFloat(s[2], 64)
		d, _ := strconv.ParseFloat(s[3], 64)
		e, _ := strconv.ParseFloat(s[4], 64)
		f, _ := strconv.ParseFloat(s[5], 64)
		x := ((b * f) - (c * e)) / ((b * d) - (a * e))
		y := ((a * f) - (c * d)) / ((a * e) - (b * d))
		if x == 0 {
			fmt.Printf("0.000 %.3f\n", y)
		} else if y == 0 {
			fmt.Printf("%.3f 0.000\n", x)
		} else {
			fmt.Printf("%.3f %.3f\n", x, y)
		}
	}
}

C++: // includes
#include <cstdio>
#include <cstdint>
#include <iostream>
#include <iomanip>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <utility>
#include <functional>
#include <cmath>
#include <climits>
#include <bitset>

// macros
#define ll long long int
#define pb push_back
#define mk make_pair
#define pq priority_queue
#define FOR(i, a, b) for(int i=(a); i<(b);++i)
#define rep(i, n) FOR(i, 0, n)

using namespace std;

//  types
typedef pair<int, int> P;
typedef pair<ll, int> Pl;
typedef pair<ll, ll> Pll;
 
// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double EPS = 1e-10;

// solve

int main(int argc, char const* argv[])
{
  double a, b, c, d, e, f;
  while(cin >> a){
    cin >> b >> c >> d >> e >> f;
    double det = a * e - b * d;
    cout << setprecision(12);
    cout << double((ll)((e * c - b * f) / det * 1000) / 1000.);
    cout << " ";
    cout << double((ll)((- d * c + a * f) / det * 1000) / 1000.) << endl;
  }
	return 0;
}

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

int main(){
    float a, b, c, d, e, f, x, y, dividedNum1, dividedNum2 = 0;
    while(cin >> a >> b >> c >> d >> e >> f){
        dividedNum1 = a;
        dividedNum2 = d;
        a /= dividedNum1;
        b /=dividedNum1;
        c /= dividedNum1;
        d /= dividedNum2;
        e /= dividedNum2;
        f /= dividedNum2;
        
        float temp1 = b - e;
        float temp2 = c - f;
        
        y = floor(((temp2 / temp1) + 0.0005) * 1000) / 1000;
        x = floor((c - (b * y) + 0.0005)* 1000) / 1000;
        
        cout << fixed << setprecision(3) << x << " " << fixed << setprecision(3) << y << endl;
    }
    return 0;
}

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

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

    std::cin >> a;
    std::cin >> b;
    std::cin >> c;
    std::cin >> d;
    std::cin >> e;
    std::cin >> f;

    if(a >= d && fmodf(a, d) == 0) {
      y = (c - (f * (a / d))) / (b - (e * (a / d)));
      x = (c - (b * y)) / a;
    }
    else if(a < d && fmodf(d, a) == 0) {
      y = (f - (c * (d / a))) / (e - (b * (d / a)));
      x = (c - (b * y)) / a;
    }
    else if(b >= e && fmodf(b, e) == 0) {
      x = (c - (f * (b / e))) / (a - (d * (b / e)));
      y = (c - (a * x)) / b;
    }
    else if(b < e && fmodf(e, b) == 0) {
      x = (f - (c * (e / b))) / (d - (a * (e / b)));
      y = (c - (a * x)) / b;
    }
    else {}

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

  return 0;
}

C++: #include<stdio.h>

void printFunc(int a,int b,int c,int d,int e,int f);

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

  scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f);
  printFunc(a,b,c,d,e,f);
  scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f);
  printFunc(a,b,c,d,e,f);

  return 0;
}

void printFunc(int a,int b,int c,int d,int e,int f){
  float ansX,ansY;
  if(b == 0 || e == 0){
    ansY = 0;
  }
  else{
    ansY = (float)(c*d - f*a)/(float)(b*d - e*a);
  }

  if(a == 0 || d == 0){
    ansX = 0;
  }
  else{
    ansX = (float)(c*e - f*b)/(float)(a*e - d*b);
  }

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

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

int main(){
	float a,b,c,d,e,f,x,y;
	while(scanf("%f",&a)){
	scanf("%f%f%f%f%f",&b,&c,&d,&e,&f);
	x=(c*e-b*f)/(a*e-b*d);
	y=(c*d-a*f)/(b*d-a*e);
	printf("%.3f %.3f",x,y);
	cout<<endl;
	}
	return 0;
	}

C++: #include<cstdio>

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

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

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

#define all(c) (c).begin(), (c).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb(e) push_back(e)
#define mp(a, b) make_pair(a, b)
#define fr first
#define sc second

typedef unsigned long long ull;
typedef long long ll;

const int INF=100000000;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

using namespace std;

typedef pair<int ,int > P;

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

int main()
{

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

	}
	


	return 0;
}

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

double halfadjust(double x){
	int tmp = (x*10000);
	tmp = tmp%10;
	double ans = static_cast<double>(static_cast<int>(x*1000));
	ans = ans/1000;
	if(tmp >= 5)
		ans += 0.001;
	if(tmp <= -5)
		ans -= 0.001;
	return ans;
}

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

void solve(){
	using namespace std;
	double x = (c*e-b*f)/(a*e-b*d);
	double y = (c*d-a*f)/(b*d-a*e);
	cout << setprecision(3) << fixed << halfadjust(x) << ' ';
	cout << halfadjust(y) << endl;
	cout << setprecision(6);
}

int main(){
	while(true){
		std::cin >> a >> b >> c >> d >> e >> f;
		if(!a&&!b&&!c&&!d&&!e&&!f)
			break;
		solve();
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

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

C++: #include <iostream>

auto main () -> int
{
    int a , b , c , d , e , f;
    while (std::cin >> a >> b >> c >> d >> e >> f)
    {
        auto delta = a * e - b * d;
        auto x = 1000ll * (e * c - b * f) / delta;
        auto y = 1000ll * (- c * d + a * f) / delta;
        std::printf ("%lld.%03lld %lld.%03lld\n" , x / 1000 , x % 1000 , y / 1000 , y % 1000);
    }
}

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

int main() {
    float a, b, c, d, e, f;
    while(~scanf("%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f)) {
        float det = a*e - b*d;
        assert(det != 0);
        float inv[2][2] = { {e / det, -b / det}, {-d / det, a / det} };
        printf("%.3f %.3f\n", (inv[0][0] * c + inv[0][1] * f), (inv[1][0] * c + inv[1][1] * f));
    }
}