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 <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <queue>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <complex>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <stdio.h>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<double> VEC;
typedef vector<VEC> MAT;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<int, PII> TIII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
//container util

//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define MT(a,b,c) MP(a, MP(b, c))
#define T1 first
#define T2 second.first
#define T3 second.second.first
#define T4 second.second.second

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define EPS 1.0e-9

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

C++: #include<iostream>
#include<cstdio>
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 = (a*f - c*d) / (a*e - b*d);
		if (x == 0)x = 0;
		if (y == 0)y == 0;
		printf("%.6f %.6f\n", x, y);
	}
    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){
    cout << fixed << setprecision(3) << (c * e - b * f) / (a * e - b * d) << ' ' << (a * f - c * d) / (a * e - b * d) << endl;
  }
}

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

using namespace std;


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

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

    return 0;
}

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

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

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

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

C++: #include <stdio.h>

#define X 0
#define Y 1
#define C 2
#define SIKI1 0
#define SIKI2 1
#define LEFT  0
#define RIGHT 1

int main(){
	double A[3][3][3];
	double n[6];

	while( scanf("%lf %lf %lf %lf %lf %lf",&n[0],&n[1],&n[2],&n[3],&n[4],&n[5]) != EOF){
		//ÏÌú»
		for(int i=0 ; i<=RIGHT ; i++){
			for(int j=0 ; j<=SIKI2 ; j++){
				for(int k=0 ; k<=C ; k++){
					A[i][j][k] = 0;
				}
			}
		}

		//lÌãü
		A[LEFT][SIKI1][X]  = n[0];
		A[LEFT][SIKI1][Y]  = n[1];
		A[RIGHT][SIKI1][C] = n[2];
		A[LEFT][SIKI2][X]  = n[3];
		A[LEFT][SIKI2][Y]  = n[4];
		A[RIGHT][SIKI2][C] = n[5];

		//®PÌXð¶Ó©çEÓÖÚ·é
		A[ RIGHT ][ SIKI1 ][ X ]  += (-1.0)*(A[ LEFT ][ SIKI1 ][ X ]);
		A[ LEFT  ][ SIKI1 ][ X ]  = 0;

		//®PÌ¼ÓðYÌWÅé		
		A[ RIGHT ][ SIKI1 ][ X ]  /= A[ LEFT ][ SIKI1 ][ Y ];
		A[ RIGHT ][ SIKI1 ][ C ]  /= A[ LEFT ][ SIKI1 ][ Y ];
		A[ LEFT  ][ SIKI1 ][ Y ]  = 1;

		//®QÌYÉãüµÄ®Qð(ax = b)Ì`É·é
		int a = A[ LEFT ][ SIKI2 ][ Y ];
		A[ LEFT  ][ SIKI2 ][ X ]  += a * A[ RIGHT ][ SIKI1 ][ X ];
		A[ LEFT  ][ SIKI2 ][ Y ]   = 0;
		A[ RIGHT ][ SIKI2 ][ C ]  += a * A[ RIGHT ][ SIKI1 ][ C ] * (-1.0);
		//XYÌðªÜé
		double answerX = A[ RIGHT ][ SIKI2 ][ C ] / A[ LEFT ][ SIKI2 ][ X ];
		double answerY = (n[2] + n[0]*answerX*(-1.0))/n[1];
		
		//¬æSÊðlÌÜü·é
		if( (((int)(answerX*10000))%10) >= 5){
			answerX += 0.001;
		}
		if( (((int)(answerY*10000))%10) >= 5){
			answerY += 0.001;
		}
		if(answerX==-0.0){
			answerX = 0;
		}
		
		//ðÌoÍ
		printf("%.3f %.3f\n", answerX , answerY);
	}

	return 0;
}

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

using namespace std;

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


double x(double, double, double, double, double, double) {

	return (c*e - b*f) / (a*e - b*d);
}

double y(double, double, double, double, double, double) {

	return (a*f - c*d) / (a*e - b*d);
}

double round(double dat, int keta ){

	int fct;
	fct =  pow(10, keta - 1);
	dat *= fct;
	dat += (dat < 0) ? -0.5 : 0.5;
	dat = (int)(dat);
	dat /= fct;
	return dat;
}

int main()
{
	double x1, x2, y1, y2;
	cin >> a >> b >> c >> d >> e >> f;

	x1 = x(a, b, c, d, e, f);
	y1 = y(a, b, c, d, e, f);

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

	x2 = x(a, b, c, d, e, f);
	y2 = y(a, b, c, d, e, f);

	cout << fixed << setprecision(3) << round(x1,3) << " " << round(y1,3) << endl;
	cout << fixed << setprecision(3) << round(x2,3) << " " << round(y2,3) << endl;

	return 0;
}

C++: #include<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<vector>
#include<functional>
#include<algorithm>
#include<cstdio>
using namespace std;
int main() {
	int a, b, c, d, e, f;
	while (cin >> a >> b >> c >> d >> e >> f) {
		int a2 = a, b2 = b, c2 = c;
		int g = a, h = d;
		if (g > h) swap(g, h);
		while (g != 0) {
			int k = g;
			g = h%g;
			h = k;
		}
		h = (h*(a / h)*(d / h));
		b = b*(h / a);
		c = c*(h / a);
		e = e*(h / d);
		f = f*(h / d);
		long double ansx = ((long double)(f - c) / (e - b)), ansy;
		ansy = (c2 - ansx*b2) / a2;
		printf("%LF %LF", ansy, ansx);
		cout << endl;
	}
}