Go: package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	var strs []string
	var a, b, c, d, e, f float64
	var x, y float64
	for scanner.Scan() {
		strs = strings.Split(scanner.Text(), " ")
		_a, _ := strconv.Atoi(strs[0])
		_b, _ := strconv.Atoi(strs[1])
		_c, _ := strconv.Atoi(strs[2])
		_d, _ := strconv.Atoi(strs[3])
		_e, _ := strconv.Atoi(strs[4])
		_f, _ := strconv.Atoi(strs[5])
		a = float64(_a)
		b = float64(_b)
		c = float64(_c)
		d = float64(_d)
		e = float64(_e)
		f = float64(_f)
		y = (c*d - f*a) / (d*b - a*e)
		x = (c - b*y) / a

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

C++: #include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <memory.h>
#include <cmath>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <ctime>
#include <iostream>
#include <functional>
#include <complex>
#include <iomanip>
#pragma comment(linker, "/STACK:836777216")

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
typedef pair<pii, int> p3i;
typedef vector<int> vi;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef vector<p3i> v3i;
typedef vector<vii> vvii;
typedef vector<p3i> vp3i;
typedef long double ld;
typedef vector<ld> vld;

#define pb push_back
#define mp make_pair
#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define REPD(i, n) for (int (i) = (n) - 1; (i) >= 0; (i)--)
#define FOR(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define FORD(i,a, b) for (int (i) = (a); (i) >= (b); (i)--)
#define sz(v) (int)(v).size()
#define all(v) (v).begin(), (v).end()
#define rv(v) reverse(all(v))
#define CL(v, val) memset((v), (val), sizeof((v)))
#define SORT(a) sort(all(a))
#define un(v) SORT(v), (v).resize(unique(all(v)) - (v).begin())
#define eps 1.0e-7
#define X first
#define Y second
#define bit(n) (1 << (n))
#define bit64(n) (ll(1) << (n))
#define sqr(n) ((n) * (n))

ll DET(ll a, ll b, ll c, ll d) {
  return a * d - b * c;
}

int main(void) {
  ll a,b,c,d,e,f;
  while (scanf("%lld%lld%lld%lld%lld%lld", &a, &b, &c, &d, &e, &f) == 6) {
    ll det = DET(a,b,d,e);
    ll det1 = DET(c,b,f,e);
    ll det2 = DET(a,c,d,f);
    double x = 1.0 * det1 / det;
    double y = 1.0 * det2 / det;
    printf("%.4lf %.4lf\n", x + eps, y + eps);
  }
  return 0;
}

C++: #include <cstdio>

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

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define MOD 1000000007 //10^9+7
#define INF 1000000000 //10^9

double round3(double x);
pair<double, double>equ2(int a,int b,int c,int d,int e,int f);

pair<double, double>equ2(int a,int b,int c,int d,int e,int f){
    double det=1.0/(a*e-b*d);
    double x=(double)(c*e-b*f)*det;
    double y=(double)(a*f-c*d)*det;
    if (x==-0) x=0;if (y==-0) y=0;
    return pair<double, double>(round3(x),round3(y));
}

double round3(double x){
    if(x>=0) return floor((x+0.0005)*1000)/1000.0;
    return -1*floor((-1*x+0.0005)*1000)/1000.0;
}

int main ()
{
    string str;
    while (!cin.eof()) {
        int a,b,c,d,e,f;
        
        cin>>a>>b>>c>>d>>e>>f;
        
        pair<double,double> ans=equ2(a,b,c,d,e,f);
        
        printf("%.3f %.3f\n",ans.first,ans.second);
    }
    return 0;
}

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

using namespace std;

int main()
{
	double x, y, det;
	vector<double> a(3);
	vector<double> b(3);
	while(1)
	{
		for (int i = 0; i < 3; i++)
		{
			cin >> a[i];
		}
		for (int i = 0; i < 3; i++)
		{
			cin >> b[i];
		}
		if (cin.eof())
		{
			break;
		}
		det = a[0] * b[1] - a[1] * b[0];
		x = (b[1] * a[2] - b[2] * a[1]) / det + 0;
		y = (-a[2] * b[0] + a[0] * b[2]) / det + 0;
		cout << fixed << setprecision(3) << x << " " << y << endl;
	}
}

C++: #include <stdio.h>

double sishagonyu(double num)	{
	
	int num2;
	
	if (num == 0) return num;
	if (num > 0) { 
		num += 0.0005;
	} else {
		num -= 0.0005;
	}
	/*
	num *= 1000;
	num2 = (int)num;
	num = num2;
	num /= 1000;
	*/
	return num;
}

int main() {
	
	double a, b, c, d, e, f;	//scanf
	double x, y;							//ans
	
	double n = 0, m = 0, j = 0, h = 0, i = 0;						//temp
	
	while(scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF){
		
		//if (scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) == EOF) break;
		
		//printf("%lf %lf %lf\n%lf %lf %lf\n", a, b, c, d, e, f);	//input
		
		n = a / d;
		
		j = d * n;
		h = e * n;
		i = f * n;
		
		//printf("%lf %lf %lf\n%lf %lf %lf\t\t%lf\n", a, b, c, j, h, i, n);
		
		m = b - h;
		y = c - i;
		//printf("%lf %lf\n", m, y);
		
		if(y != 0) y /= m;
		//printf("%lf\n", y);
		
		i = c - (b * y);
		x = i / a;
		
		//printf("x = %lf, y = %lf\n", x, y);
		
		x = sishagonyu(x);
		y = sishagonyu(y);
		
		//printf("%lf %lf\n", x, y);
		printf("%.3lf %.3lf\n", x, y);
			}
	return 0;
}

//1 2 3 4 5 6
//-1.000 2.000

//2 -1 -2 -1 -1 -5
//1.000 4.000

//2 -1 -3 1 -1 -3
//0.000 3.000

// 2 -1 -3 -9 9 27
// 0.000 3.000

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

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

C++: #include<iostream>
#include<string>
#include<stdio.h>
#include<cctype>
#include<algorithm>
#include<climits>
#include<cmath>
#include<map>
#include<vector>
#define INF INT_MAX
using namespace std;

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

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

	return 0;
}

C++: #include <algorithm>
#include <map>
#include <vector>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cctype>
#include <cstdlib>
#include <cmath>
#include <string>
#include <queue>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define IREP(it,array) for(vector<int>::iterator it=array.begin(); it!=array.end(); ++it)
#define SREP(it,array) for(vector<string>::iterator it=array.begin(); it!=array.end(); ++it)
#define MP make_pair

double rou(double d){
  if( abs(d) < 0.0001)
    return 0.0;
  return d;
}

int main()
{
  cout.setf(ios::fixed, ios::floatfield);
  cout.precision(3);

  int INF = 1000000;

  int a,b,c,d,e,f;
  while(cin>>a>>b>>c>>d>>e>>f){
    cout << rou((double)(c*e-b*f)/(a*e-b*d)) << " "
	 << rou((double)(c*d-a*f)/(b*d-a*e)) << endl;
  }


  return 0;
}

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

string toStr(int n);
string intToString(int n);

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

  while(cin >> a >> b >> c >> d >> e >> f) {
    a = a * 10000;
    b = b * 10000;
    c = c * 10000;
    d = d * 10000;
    e = e * 10000;
    f = f * 10000;
    
    int x, y;
    int det = a * e - b * d;

    x = ( e * c - b * f) / det;
    y = (-d * c + a * f) / det;

    cout << toStr(x) << " " << toStr(y) << endl;
  }
}

string toStr(int n) {
  int ipart = n / 10000;
  int fpart = (n - ipart * 10000) + 5;
  return intToString(ipart) + "." + intToString(fpart).substr(0, 3);
}

string intToString(int n) {
  stringstream ss;
  ss << n;
  return ss.str;
}