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++: #include <functional>
#include <algorithm>
#include <iostream>
#include <sstream>
#include <cstring>
#include <iomanip>
#include <fstream>
#include <climits>
#include <cctype>
#include <cstdio>
#include <string>
#include <vector>
#include <bitset>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <deque>
#include <list>
#include <map>
#include <set>
using namespace std;

/*** typedef ***/
typedef long long LL;
typedef unsigned int ui;
typedef unsigned long long ULL;
typedef pair < int , int > ii;
typedef pair < LL  , LL  > ll;
typedef vector <int>  vint;
typedef vector <bool> vbool;
typedef vector <long> vlong;

/*** define ***/
#define sz(x)			((int)x.size())
#define tin(x)			scanf("%d",&x)
#define all(x)			x.begin(),x.end()
#define Set(b,a)		memset(b,a,sizeof b)
#define print1(x)		printf("Case %d:",x++)
#define tin2(x,y)		scanf("%d%d",&x,&y)
#define tin3(x,y,z)		scanf("%d%d%d",&x,&y,&z)
#define loop(i,i0,in)	for(int i=i0 ; i<in ; i++)
#define rep(i,n)		for(int i=0 ; i<(n) ; i++)
#define _rep(i,n)		for(int i=n-1 ; i>=0 ; i--)
#define _loop(i,in,i0)	for(int i=in-1 ; i>=i0 ; i--)
#define Fore(it, x)		for(typeof (x.begin()) it = x.begin(); it != x.end (); it++)
     
int main()  
{  
#ifdef Online_Judge
	freopen("a.in","r",stdin);
#endif
	long long a,b,c,d,e,f;
	while(cin >> a >> b >> c >> d >> e >> f)
	{
		long double x=((c*e) - (b*f))/((a*e)-(b*d));
		long double y=((a*f) - (c*d))/((a*e)-(b*d));
		printf("%.3lf %.3lf\n",x,y);
	}
	return 0;
}

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

}
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){
		y=(c*d-a*f)/(b*d-a*e);
		x=(c-b*y)/a;
		
		x=round3(x);
		y=round3(y);
		
		printf("%0.3lf %0.3lf\n",x,y);
	}
	return 0;
}

C++: #include <cmath>
#include <iomanip>
#include <iostream>
#include <vector>
#define N 2
 
using namespace std;
typedef vector< vector<double> > Equation;
 
int main()
{ 
    Equation c(N, vector<double>(N + 1));
	while (cin)
	{
		// input
		for (int i = 0; i < N; ++i)
			for (int j = 0; j < N + 1; ++j)
				cin >> c[i][j];

		// Gaussian elimination
		// 1. Forward elimination
        for (int i = 0; i < N - 1; ++i)
            for (int j = i + 1; j < N; ++j)
            {
                double d = c[j][i] / c[i][i];
                for (int k = i + 1; k <= N; ++k)
                    c[j][k] -= c[i][k] * d;
            }
 
		// 2. Back substitution
        for (int i = N - 1; i >= 0; --i)
        {
            double d = c[i][N];
            for (int j = i + 1; j < N; ++j)
                d -= c[i][j] * c[j][N];
            c[i][N] = d / c[i][i];
        }
 
		for (int i = 0; i < N; ++i)
			if (abs(c[i][N]) == 0.0)
				c[i][N] = 0.0;

        cout << setprecision(3) << fixed << c[0][N];
        for (int i = 1; i < N; ++i)
            cout << " " << c[i][N];
        cout << endl;
    }
 
    return 0;
}

C++: #include<iostream>
#include<iomanip>
#define x_Formula(a,b,c,d,e,f) (c-(b*f)/e)/(a-(b*d)/e);
#define y_Formula(x,a,b,c) (c-(a*x))/b;

using namespace std;

double x;
double y;

void serch()
{
	int xx,yy;
	xx=x*1000;
	yy=y*1000;
//	cout << xx << " " << yy << endl;
	if(xx>0)
		xx+=5;
	else
		xx-=5;
	if(yy>0)
		yy+=5;
	else
		yy-=5;
	x=xx/1000;
	y=yy/1000;
//	cout << xx << " " << yy << endl;

}
int main()
{
	double num[6];
	int i;
	
	for(;cin >> num[0];)
	{
		for(i=1;i<6;i++)
			cin >> num[i];
		
		x=x_Formula(num[0],num[1],num[2],num[3],num[4],num[5])
		y=y_Formula(x,num[0],num[1],num[2])
		
		cout << setprecision(3);
		cout << setiosflags(ios::scientific);
		cout << fixed ;
		serch();
		cout << x << " " << y << endl;
	}
}

C++: #include <iostream>
#include <cstdio>
int main(){
float a,b,c,d,e,f,x,y;
while(std::cin>>a>>b>>c>>d>>e>>f){
	x = (b*f-c*e)/(b*d-a*e);
	y = (f*a-d*c)/(a*e-b*d);
	printf("%.4f %.4f\n",x==-0.000?0.000:x, y==-0.000?0.000:y);
}
}

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

using namespace std;

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

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

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

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

void Simaltaneous(double a,double b,double c,double d,double e,double f){
    double x,y;
    y=(a*f-d*c)/(a*e-d*b);
    x=(c-b*y)/a;
    printf("%4.3f %4.3f\n",x,y);
    return ;
}

int main(){
    double a,b,c,d,e,f;
    while(cin >>a>>b>>c>>d>>e>>f){
        Simaltaneous(a,b,c,d,e,f);
    }
    return 0;
}

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

#include <math.h>
using namespace std;

int main()
{
	double A, B, C, D, E, F, X, Y, G , H;

	while(cin >> A >> B >> C >> D >> E >> F)
	{
		G = A / D;
		D *= G;
		E *= G;
		F *= G;
		Y = (F-C) / (E-B);
		
		D /= G;
		E /= G;
		F /= G;
		H = B / E;
		D *= H;
		E *= H;
		F *= H;
		X = (F-C) / (D-A);

		if(X==0){X=0};
		if(Y==0){Y=0};

		printf("%.3f %.3f\n",X,Y);
	}

	return 0;
}

C++: #include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
using namespace std;

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

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

// 一行取って、一番初めのTを習得
template <class T> int streamvar(std::istream& in, T& var)
{
    string s;
    if (!in) {
        return 1;
    }
    getline(in, s);
    istringstream is(s);
    is >> var;
    if (is.fail()) 
        return 1;
    return 0;
}
// 一行取って、T vectorに格納する
template <class T> int streamvec(std::istream& in, std::vector<T> &v)
{
    v.clear();
    string s;

    if (!in) 
        return 1;
    getline(in, s);
    if (in.fail()) 
        return 1;
    istringstream is(s);
    while (1) {
        T tmp;
        is >> tmp;
        if (is.fail())
            break;
        v.push_back(tmp);
    }
    return 0;
}

int main(void)
{
    vector<int> v;
    while (!streamvec(cin, v)) {
        double det = v[0] * v[4] - v[3] * v[1];
        double x = v[4] * v[2] - v[1] * v[5];
        double y = -v[3] * v[2] + v[0] * v[5];
        printf("%.3f %.3f\n", round(x/det*1000)/1000, round(y/det*1000)/1000);
    }
    return 0;
}