Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextFloat64() (float64, error) {
	return strconv.ParseFloat(nextString(), 64)
}

func mathRound(f float64) float64 {
	return math.Floor(f + .5)
}

func round(x float64) float64 {
	if math.Abs(x) < 0.001 {
		return 0
	}
	return mathRound(x*1000) / 1000
}

func main() {
	scanner.Split(bufio.ScanWords)
	for {
		a, err := nextFloat64()
		if err != nil {
			break
		}
		b, _ := nextFloat64()
		c, _ := nextFloat64()
		d, _ := nextFloat64()
		e, _ := nextFloat64()
		f, _ := nextFloat64()

		detA := a*e - b*d
		x := (c*e - b*f) / detA
		y := (a*f - c*d) / detA

		fmt.Printf("%.3f %.3f\n", round(x), round(y))
	}
}

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

using namespace std;

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

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

        cout << setprecision (3) << fixed << x << " " << y <<endl;
    }
    return 0;
}

C++: //
//  main.cpp
//  Sample
//
//  Created by h3037183 on 2017/07/31.
//  Copyright ?? 2017??´ ?°????. All rights reserved.
//

#include <iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main(){
    double a,b,c,d,e,f,x,y;
    for(;;){
    cin>>a>>b>>c>>d>>e>>f;
    x=(c*e-b*f)/(a*e-b*d);
    y=(c*d-f*a)/(b*d-a*e);
    printf("%.3lf %.3lf",x,y);
    cout<<endl;
    }
    return 0;
}

C++: #include<iostream>
#include<iomanip>
#include<string>
#include<vector>
#include<set>
#include<algorithm>
#include<map>
#include<cmath>

using namespace std;

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

	return 0;
}

C++: #include<stdio.h>
int main(){
	double a,b,c,d,e,f;
	double x,y,z,v;
	scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f);
	x=(c*e-b*f)/(a*e-b*d);
	y=(c*d-a*f)/(b*d-a*e);
	if(x>=-0.0005&&x<0.0005)	x=0;
	if(y>=-0.0005&&y<0.0005)	y=0;
	printf("%.3lf %.3lf\n",x,y);
}

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

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define IN(a, b, x) (a<=x&&x<b)
#define MP make_pair
#define PB push_back
#define MOD 1000000007
#define INF (1LL<<30)
#define LLINF (1LL<<60)
#define PI 3.14159265359
#define EPS 1e-12
//#define int ll

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

C++: #include<bits/stdc++.h>
using namespace std;

double Round4(double r){
    r=(int)round(r*1000);
    r=(double)r/1000;
    return(r);
}

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

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

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

int main(void)
{
	double a,b,c,d,e,f;
	double ans[2];

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

	ans[1] = (c*d-a*f)/(b*d-a*e);
	ans[0] = (c*d-b*d*ans[1])/(a*d);

	if(ans[1] < 0.0005)
		ans[1] *= -1;
	if(ans[0] < 0.0005)
		ans[0] *= -1;

	printf("%.3lf %.3lf\n", ans[0],ans[1]);

	return 0;
}

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

void OutputSolution(int a, int b, int c, int d, int e, int f)
{
	int B = b;
	a *= e;
	b *= e;
	c *= e;
	d *= B;
	e *= B;
	f *= B;
	double x = (c-f) / (a-d);
	double y = (c-a*x) / b;
	cout << x << ' ' << y << endl;
}

int main()
{
	while(true){
		int a, b, c, d, e, f;
		cin >> a >> b >> c >> d >> e >> f;
		if(cin.eof()) break;
		OutputSolution(a, b, c, d, e, f);
	}
	return 0;
}

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

using namespace std;

double EPS = 1e-9;

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;
		
		y = (c - a*f/d)/(b - a*e/d);
		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>
#include <iomanip>

int main()
{
	double a, b, c, d, e, f;
	while (std::cin >> a >> b >> c >> d >> e >> f) {
		double const denominator = a * e - b * d;
		long long const x1000 = ((c * e - b * f) / denominator + 0.0005) * 1000;
		long long const y1000 = ((a * f - c * d) / denominator + 0.0005) * 1000;
		std::cout.setf(std::ios::fixed);
		std::cout.precision(3);
		std::cout << std::showpoint
				  << x1000 / 1000.0 << ' ' << y1000 / 1000.0 << std::endl;
	}
	return 0;
}

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

C++: #include<iostream>
using namespace std;
int main()
{
	double a, b, c, d, e, f,x,y;
	while (cin >> a >> b >> c >> d >> e >> f)
	{
		x = (e*c - b*f) / (a*e - b*d);
		y = (a*f - c*d) / (a*e - b*d);
		x=  x * 1000;
		x = x / 1000;
		y = y * 1000;
		y = y / 1000;
		cout<<x<<" "<<y<< endl;
	}
	return 0;
}

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

using namespace std;

int main(){
  double a,b,c,d,e,f;
  vector<double> al,bl,cl,dl,el,fl;
  double x,y,n,m;

  while(cin >> a >> b >> c >> d >> e >> f){
    al.push_back(a);
    bl.push_back(b);
    cl.push_back(c);
    dl.push_back(d);
    el.push_back(e);
    fl.push_back(f);
  }

  for(int i=0; i<al.size(); i++){
    n = bl[i]/el[i];
    m = al[i]/dl[i];
    x = (cl[i]-n*fl[i])/(al[i]-n*dl[i]); 
    y = (cl[i]-m*fl[i])/(bl[i]-m*el[i]);
    if(x == 0){
      x = 0;
    }else if(y == 0){
      y = 0;
    }
    cout << setprecision(3) << fixed << x << " " << y << endl;
  }

  return 0;
}