Go: package main

import (
	"fmt"
)

func main() {
	for {
		var a, b, c, d, e, f float64
		i, _ := fmt.Scan(&a, &b, &c, &d, &e, &f)
		if i == 0 {
			break
		}

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

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

C++: #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));
	const double EPS = 1.0e-10;

	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 (-0.0005 < c[i][N] && c[i][N] < 0.0 + EPS) 
				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>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
#include <functional>
using namespace std;

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

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

using namespace std;

double a, b, c, d, e, f;
double tmp_x, tmp_y, tmp;

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

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

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

}

C++: #include <cstdio>

using namespace std;

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

    return 0;
}

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)
	{
		-1000 <= a, b, c, d, e, f <= 1000;
		x= (c*e-b*f)/(a*e-b*d);
		y= (c*d-a*f)/(b*d-a*e);
		if(x == -0.00){x=0.00;}
		if(y == -0.00){y=0.00;}
		cout<<setprecision(3)<<x<<y<<endl;
                cout<<fixed;
		cout<<x<<" "<<y<<endl;
	}
	return 0;
}

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

using namespace std;

void inputData(vector<string>& data_set) {
	string buffer;
	while(getline(std::cin,buffer))
		data_set.push_back(buffer);
}

vector<string> splitString(const string& str, const string& separator = " ") {
	vector<string> ret;

	std::size_t bp, ep;
	bp = ep = 0;
	while((ep = str.find_first_of(separator, bp)) != string::npos){
		if(bp != ep){
			ret.push_back(string(str.begin() + bp, str.begin() + ep));
		}
		bp = ep + 1;
	}

	if(bp <= str.size() - 1){
		ret.push_back(string(str.begin() + bp, str.end()));
	}

	return ret;
}

template <class T>
T convertStringToNumber(const string& str) {
	stringstream ss;
	T ret;

	ss << str;
	ss >> ret;

	return ret;
}



vector<double> parseStringData(const string& data_str) {
	auto buff = splitString(data_str);

	vector<double> ret(buff.size());
	for(int i = 0; i < buff.size(); ++i){
		auto temp = convertStringToNumber<double>(buff[i]);
		ret[i] = temp;
	}

	return ret;
}


void displayAnswer(const vector<double>& data_set) {
	double det = 1.0 / (data_set[0] * data_set[4] - data_set[1] * data_set[3]); 
	double x = det * (data_set[4] * data_set[2] + -data_set[1] * data_set[5]);
	double y = det * (-data_set[3] * data_set[2] + data_set[0] * data_set[5]);

	x = round(x * 1000) / 1000.0;
	y = round(y * 1000) / 1000.0;

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


void doAllProcess() {
	vector<string> buffer;
	inputData(buffer);

	for(int i = 0; i < buffer.size(); ++i){
		auto data_set = parseStringData(buffer[i]);
		displayAnswer(data_set);
	}
}


int main() {
	doAllProcess();

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

C++: #include<stdio.h>
int main()
{
    int a,b,c,d,e,f;
    float x,y;
    while(scanf("%d %d %d %d %d %d", &a,&b,&c,&d,&e,&f)!=EOF)
    {
            x=float(c*e-b*f)/(a*e-b*d);
            y=float(a*f-c*d)/(a*e-b*d);
            printf("%.3f %.3f\n",x,y);

    }
    return 0;
}

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

int main(){
	double a, b, c, d, e, f;
	while(std::cin >> a){
		std::cin >> b >> c >> d >> e >> f;
		std::cout << std::fixed << std::setprecision(3)
			<< floor((c * e - b * f) / (a * e - b * d) + 0.5) << ' '
			<< floor((a * f - c * d) / (a * e - b * d) + 0.5) << std::endl;
	}
	return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
using namespace std;

int main()
{
//	cut here before submit 
//	freopen("testcase.se2", "r", stdin);
	string str = "";

	while (getline (cin, str )){
		// ax + by = c
		// dx + ey = f
		int a, b, c, d, e, f;
		stringstream ss(str);
		ss >> a >> b >> c >> d >> e >> f;
		// [ a b ][x] = [c]
		// [ d e ][y]   [f]
		// [x] = [e -b][c]
		// [y]   [-d a][f]/D
		double x,y;
		double D = (double)(a*e - b*d);

		x = (double)(e*c - b*f)/D;
		y = (double)(-d*c + a*f)/D;
		if (fabs(x) < 1.0e-6){
			x = 0.0;
		} // end if
		if (fabs(y) < 1.0e-6){
			y = 0.0;
		} // end if
		cout.setf( ios::fixed ); 
		cout.precision(3);
		cout << x << ' ' << y << endl;
	} // end for

	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){
  double x, y;
  x = ((b*f)/e -c)/((b*d)/e-a);
  y = ((a*f)/d -c)/((a*e)/d-b);
  if(y == 0)y = 0;
  if(x == 0)x = 0;
  cout << fixed << setprecision(3) << x << " " << y << endl;
  }
  return 0;
}

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

#define MAX 256

int main(void){

	float a, b, c, d, e, f;
	float ansx[MAX], ansy[MAX];

	int i = 0;

	while (scanf("%f%f%f%f%f%f", &a,&b,&c,&d,&e,&f) != EOF){
		if (a*e != b*d){
			ansx[i] = (c*e - b*f) / (a*e - b*d);
			ansy[i] = (c*d - a*f) / (b*d - a*e);
			if (((int)(ansx[i] * 10000) % 10) > 4 || ((int)(ansx[i] * 10000) % 10) < -4){
				ansx[i] += 0.001;
			}
			if (((int)(ansy[i] * 10000) % 10) > 4 || ((int)(ansx[i] * 10000) % 10) < -4){
				ansy[i] += 0.001;
			}
		}
		i++;
	}

	if (i == 0)printf("\n");

	for (int j = 0; j < i; j++){
		printf("%.3f %.3f\n", ansx[j], ansy[j]);
	}
	
	return 0;
}