Go: package main

import "fmt"

func main() {
	var resultX, resultY [100]float32
	var count int
	for {
		var a, b, c, d, e, f, x, y float32
		fmt.Scanf("%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f)
		if a == 0 {
			break
		}
		//Simultaneous equation
		y = (((a * f) - (d * c)) / ((a * e) - (b * d)))
		x = ((c - (b * y)) / a)
		resultX[count] = x
		resultY[count] = y
		count++
	}
	for i := 0; i < count; i++ {
		fmt.Printf("%.3f %.3f\n", resultX[i], resultY[i])
	}
}

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

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main(){
	double x,y;
	int a,b,c,d,e,f;
	while(cin>>a>>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 <cmath>
#include <vector>

typedef struct {
    double x;
    double y;
} xy;

int main()
{
    using namespace std;
    double a, b, c, d, e, f, x, y;
    vector<xy> results;
    
    cout.precision(3);
    cout << fixed << showpoint;
    while (cin >> a >> b >> c >> d >> e >> f) {
        double coef = d/a;
        b *= coef; c *= coef;
        y = (c - f)/(b - e);
        x = (f - e*y)/d;
        x = round(x*1000.0)/1000.0;
        y = round(y*1000.0)/1000.0;
        if (x == 0) x = fabs(x);
        if (y == 0) y = fabs(y);
        results.push_back( {x,y} );
        // cout << x << " " << y << endl;
    }
    for (vector<xy>::iterator itr = results.begin();
         itr != results.end(); ++itr) {
        // xy& tmp = *itr;
        cout << itr->x << " " << itr->y << endl;
    }
}

C++: #include <iostream>
#include <stdio.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 = (double)(c*e-b*f) / (a*e-b*d);
    y = (double)(f-d*x) / e;

    printf("%.3f %.3f\n", x, y);

  }


  return 0;
}

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

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

C++: #include <stdio.h>
double round3(double 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/1000;

	return a;

}
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 <iostream>
#include <iomanip>
using namespace std;

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

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

using namespace std;

using DataSet = vector<double>;


void readInputData(vector<string>& input_data){
    string buff;
    while(getline(cin, buff)){
        input_data.push_back(buff);
    }
}

void _parseString(const string& input_data, DataSet& data_set) {
    data_set.resize(6);

    stringstream ss;
    ss << input_data;
    ss >> data_set[0] >> data_set[1] >> data_set[2]
        >> data_set[3] >> data_set[4] >> data_set[5];
}

void parseString(const vector<string>& input_data, vector<DataSet>& data_set) {
    data_set.resize(input_data.size());
    for(int i = 0; i < input_data.size(); ++i) {
        DataSet buff;
        _parseString(input_data[i], buff);
        data_set[i] = buff;
    }
}

double determinant2d(const DataSet& data){
    return data[0] * data[4] - data[1] * data[3];
}

void inverse2d(DataSet& data){
    double t = data[0];
    data[0] = data[4];
    data[4] = t;

    data[1] = -data[1];
    data[3] = -data[3];
}


void calculateXY(const DataSet& data, double det, vector<double>& result){
    result.resize(2);

    result[0] = (data[0] * data[2] + data[1] * data[5]) / det;
    result[1] = (data[3] * data[2] + data[4] * data[5]) / det;
}

void solve(vector<DataSet>& data_set){
    cout << setprecision(3);

    for(int i = 0; i < data_set.size(); ++i){
        vector<double> buff;

        double det = determinant2d(data_set[i]);

        inverse2d(data_set[i]);

        calculateXY(data_set[i], det, buff);

        cout << (buff[0] + 0.0005) << " " << (buff[1] + 0.0005) << endl;
    }
}


void doAllProcess(){
    vector<string> input_data;
    readInputData(input_data);

    vector<DataSet> data_set;
    parseString(input_data, data_set);

    solve(data_set);
}


int main(){
    doAllProcess();
    return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <numeric>
#include <string>
#include <vector>
#include <list>
#include <iterator>

#include <cstdio>
#include <cmath>

#define DIM 2
#define EPS (5*10e-4)

typedef std::vector<double> Vec;
typedef std::vector<Vec> Mat;
typedef std::pair<Mat,Vec> Eq;

double removeMinusZero(double x){
	if ( fabs(x)< EPS ){
		return 0.0;
	}
	else {
		return x;
	}
}

int main(void){
	using namespace std;

	list<Eq> input;

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

	cout << fixed << setprecision(3);

	while(cin >> a >> b >> c >> d >> e >> f){
		Vec m1, m2;
		m1.push_back(a);
		m1.push_back(b);
		m2.push_back(d);
		m2.push_back(e);

		Vec vec;
		vec.push_back(c);
		vec.push_back(f);

		Mat mat;
		mat.push_back(m1);
		mat.push_back(m2);

		Eq eq = make_pair(mat,vec);

		input.push_back(eq);
	}

	for(auto itr = input.begin(); itr!=input.end(); ++itr){
		auto mat = itr->first;
		auto vec = itr->second;

		Vec output(DIM);

		auto det = mat[0][0] * mat[1][1] - mat[0][1] * mat[1][0];
		std::transform(vec.begin(), vec.end(),vec.begin(), std::bind1st(multiplies<double>(),1.0/det));

		mat[0][1] = -mat[0][1];
		mat[1][0] = -mat[1][0];
		swap(mat[0][0],mat[1][1]);

		for (int i=0; i<DIM; i++){
			output[i] = removeMinusZero(inner_product(vec.begin(), vec.end(), mat[i].begin(), 0));
		}

		// cout << output[0] << " " << output[1];
		printf("%.3f %.3f",output[0],output[1]);
		if( std::next(itr)!=input.end() ){
			cout << endl;
		}
	}

}

C++: #include <stdio.h>

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

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

int main() {
  double a,b,c,d,e,f;
  double x,y;
  while(cin >> a >> b >> c >> d >> e >> f) {
    x = (c*e-b*f) / (a*e-d*b);
    y = (c-a*x) / b;
    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%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);
		}
		i++;
	}

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

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