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>
#include <string>
#include <vector>
#include <sstream>

using namespace std;

using DataSet = vector<double>;

//void debug(const string& prefix, const DataSet& data);

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

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 << fixed;
    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]);
        //debug("inverse", data_set[i]);

        calculateXY(data_set[i], det, buff);
        //debug("calculate", data_set[i]);

        cout << buff[0] << " " << buff[1] << endl;
    }
}

//void debug(const string& prefix, const DataSet& data){
//
//
//    cout << prefix << endl;
//
//    cout << "Matrix:" << endl;
//    cout << data[0] << "  " << data[1] << endl;
//    cout << data[3] << "  " << data[4] << endl;
//
//    cout << "\nx_y:\n";
//    cout << data[2] << "\n" << data[5] << "\n";
//
//    cout << "\ndet: " << determinant2d(data) << endl;
//}



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

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

    solve(data_set);
}

//
//void test(){
//    vector<string> input_data;
//    input_data.push_back("1 2 3 4 5 6");
//    input_data.push_back("2 -1 -2 -1 -1 -5");
//    input_data.push_back("2 -1 -3 1 -1 -3");
//    input_data.push_back("2 -1 -3 -9 9 27");
//
//    vector<DataSet> data_set;
//    parseString(input_data, data_set);
//
//    solve(data_set);
//
//    getchar();
//}

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

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

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


double sisyagonyu(double num, int keta){

    if(keta < 1)return num;
    
    int i  = num * pow(10, keta);
    int sg = num * pow(10, keta + 1) - i * 10;
    
    
    if(sg >= 5)i++;
    else if(sg <= -5)i--;

    return i / pow(10.0, keta);
};

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 - b * d);
        y = (a * f - c * d) / (a * e - b * d);

        cout << setiosflags(ios::fixed) << setprecision(3);
        cout << sisyagonyu(x, 3) << ' ' << sisyagonyu(y, 3)  << endl;
     }
         
	return 0;
}

C++: #include <iostream>
 
using namespace std;
 
int main(int argc, char **argv)
{
    double a, b, c, d, e, f, tmp, s, t;
     
    while((cin >> a >> b >> c >> d >> e >> f)){
        tmp = (a*e-b*d);
        s = ((e*c-b*f)/tmp);
        t = ((a*f-d*c)/tmp);
         
        if(s == -0.0){
            s = 0.0;
        }
        if(t == -0.0){
            t = 0.0;
        }
        printf("%.3f %.3fn", s, t);
    }
     
    return 0;
}

C++: #include <cstdio>

int main (int argc, char *argv[]) {
	using namespace std;
	int a, b, c, d, e, f;
	while (EOF != fscanf(stdin, "%d %d %d %d %d %d\n", &a, &b, &c, &d, &e, &f)) {
		float tmp1 = static_cast<float>(f)-(static_cast<float>(c)*static_cast<float>(d)/static_cast<float>(a));
		float tmp2 = static_cast<float>(e)-(static_cast<float>(b)*static_cast<float>(d)/static_cast<float>(a));
		float y = tmp1/tmp2;
		float x = (c - b * y) / a;
		printf("%f %f\n", x, y);		
		//printf("y=%f\n", (f-(c*d/a))/(e-(b*d/a)));
	}
	
	return 0;
}

C++: #include<stdio.h>
int main(){
	double a,b,c,d,e,f;
	double A,B,C,D,E,F;
	double x,y;
	
	while(scanf("%lf%lf%lf%lf%lf%lf",&a ,&b ,&c ,&d ,&e ,&f )!=EOF){
		A=a*d;
		B=b*d;
		C=c*d;
		D=a*d;
		E=a*e;
		F=a*f;
//		printf(" %lfx + %lfy = %lf\n",A,B,C);
//		printf(" %lfx + %lfy = %lf\n",D,E,F);
		if(B==E){y=0;}
		else{y=(C-F)/(B-E);}
		if(y==-0.000){y=0;}
		x=(c-b*y)/a;
		printf("%1.3lf %1.3lf\n",x,y);
	}
	return 0;
}

C++: #include<stdio.h>
int main(void){

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

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

}

C++: #include<iostream>
#include<iomanip>
#include<cstdio>
#define eps 1e-9
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) - (b*d)) ;
        y = ((a*f) - (c*d))/((a*e) - (b*d)) ;

        printf("%.3lf %.3lf\n",x+eps,y+eps);
    }
    return 0;
}

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

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

C++: #include <cstdio>
#define LOOP(index,times) for(int index=0;index<times;index++)
using namespace std;

int main(){

float l[6];
float x,y;

while(scanf("%f %f %f %f %f %f",&l[0],&l[1],&l[2],&l[3],&l[4],&l[5]) != EOF){
	
	x=(l[2]*l[4]-l[1]*l[5])/(l[0]*l[4]-l[1]*l[3]);
	y=(l[2]*l[3]-l[0]*l[5])/(l[1]*l[3]-l[0]*l[4]);
	if(x==0)x=0;
	if(y==0)y=0;
	printf("%.3lf %.3lf\n",x,y);		

}

return 0;		
}

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

float gcd(float &m, float &n) {
	int a, b, t;
	a = (int)m;
	b = (int)n;
	while (1) {
		if (b==0) return (float)a;
		t = b;
		b = a % b;
		a = t;
	}
}

int main() {
	float a, b, c, d, e, f;
	float t, u, v;
	float x, y;
	
	while (1) {
		cin>>a>>b>>c>>d>>e>>f;
		if (cin.eof()) break;

		if (a<0.0 && d>=0.0) {
			a *= -1;
			b *= -1;
			c *= -1;
		} else if (a>=0.0 && d<0.0) {
			d *= -1;
			e *= -1;
			f *= -1;
		}
		t = a * d;
		b *= d;
		c *= d;
		e *= a;
		f *= a;
		y = (c - f)/(b - e);
		x = c - b * y;

		cout<<setprecision(3)<<setiosflags(ios::fixed)<<x<<" "<<y<<endl;
	}
	return 0;
}