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;

bool sisya(double x)
{
	x = x*1000;
	x = x - static_cast<double>(static_cast<int>(x));
	x = x+0.5;
	if(x >= 1.0){
		return true;
	}
	return false;
}

int main()
{
	double a,b,c,d,e,f;
	double x,y;
	while (cin >> a && cin >> b && cin >> c && cin >> d && cin >> e && cin >> f){
		x = (f/e - c/b) / (d/e - a/b) ;
		if(sisya(x))
			x += 0.001;
		y = (f/d - c/a) / (e/d - b/a) ;
		if(sisya(y))
			y += 0.001;
		cout << setprecision(3) << fixed << x << endl;
		cout << setprecision(3) << fixed << y << endl;
	}
	return 0;
}

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

auto main () -> int
{
    double a , b , c , d , e , f;
    while (std::cin >> a >> b >> c >> d >> e >> f)
    {
        auto delta = a * e - b * d;
        auto x = (e * c - b * f) / delta;
        auto y = (- c * d + a * f) / delta;
        auto x_ = static_cast <int> (std::round (x * 1000));
        auto y_ = static_cast <int> (std::round (y * 1000));
        std::printf ("%d.%03d %d.%03d\n" , x_ / 1000 , x_ % 1000 , y_ / 1000 , y_ % 1000);
    }
}

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

using namespace std;

/* ax + by = c
   dx + ey = f
   
   (x, y) = { (ce - bf) / (ae - bd), (af - cd) / (ae - bd) } */


void Equation2(int a, int b, int c, int d, int e, int f, double& x, double& y)
{
	x = (c * e - b * f) / (a * e - b * d);
	y = (a * f - c * d) / (a * e - b * d);
}

int main()
{
	int A[12];

	double X[2];
	double Y[2];

	for (int i = 0; i < 12; i++) { cin >> A[i]; }

	Equation2(A[0], A[1], A[2], A[3], A[4] , A[5] , X[0], Y[0]);
	Equation2(A[6], A[7], A[8], A[9], A[10], A[11], X[1], Y[1]);

	cout << fixed << setprecision(3) << X[0] << ' ' << Y[0] << endl << X[1] << ' ' << Y[1] << endl;

	return 0;
}

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

double round(double num);
/*
??£???????¨????
	ax + by = c
	dx + ey = f
????§£x, y???????????????????????°??????
*/
int main() {
	double a, b, c, d, e, f;
	int cnt = 0;						//??\??????????????£???????¨????????????°
	std::vector<double> x_vector;		//x????§£???????´?
	std::vector<double> y_vector;		//y????§£???????´?

#if 0
	while (cnt < 2) {
		cin >> a >> b >> c >> d >> e >> f;
#else
	while (cin >> a >> b >> c >> d >> e >> f) {
#endif
		double x = (b * f - c * e) / (b * d - a * e);
		double y = (c * d - a * f) / (b * d - a * e);

		cnt++;
		x_vector.push_back(x);
		y_vector.push_back(y);
	}

	for (unsigned int i = 0; i < cnt; i++) {
		double x_result = round(x_vector[i]);
		double y_result = round(y_vector[i]);

		std::cout << std::fixed;
		std::cout << std::setprecision(3) << x_result << " ";
		std::cout << std::setprecision(3) << y_result << endl;
	}

	//???????????°
	//while (1);

	return 0;
}

//?°???°????¬¬4???????????¨?????\????????¢??°
double round(double num) {
	int num_mul_10000 = (int)(double)(num * 10000);
	int num_mul_1000  = (int)(double)(num * 1000);

	//???????????°
	//cout << num_mul_10000 << " " << num_mul_1000 << endl;

	if (5 <= (num_mul_10000 - num_mul_1000 * 10)) {
		return num + 0.001;
	}
	else {
		return num;
	}
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main(){
	double a,b,c,d,e,f,g;
	while(cin>>a>>b>>c>>d>>e>>f){
		g=a;
		a*=d;
		b*=d;
		c*=d;
		d*=g;
		e*=g;
		f*=g;
		if(a==d){
			a-=d;
			b-=e;
			c-=f;
		}else{
			a+=d;
			b+=e;
			c+=f;
		}
		c/=b;
		e*=c;
		f-=e;
		f/=d;
		printf("%.3f %.3f\n",f,c);
	}
}

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

using namespace std;

int main(int argc, char *argv[]) {
  double a, b, c, d, e, f;

  while (true) {
    cin >> a >> b >> c >> d >> e >> f;
    if (cin.eof())
      break;
    a -= d * b / e;
    c -= f * b / e;
    double x = c / a;
    if (x >= 0)
      x = (int)(x * 1000 + 0.5);
    else
      x = (int)(x * 1000 - 0.5);
    x /= 1000;
    double y = (f - d * x) / e;
    if (y >= 0)
      y = (int)(y * 1000 + 0.5);
    else
      x = (int)(y * 1000 - 0.5);
    y /= 1000;

    if (x == -0.0)
      x = 0.0;
    if (y == -0.0)
      y = 0.0;
    printf("%.3lf %.3lf\n", x, y);
  }
  return 0;
}

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

using namespace std;

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

	while (cin >> a >> b >> c >> d >> e >> f) {

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

		if (x == -0) {
			x = 0;
		}

		if (y == -0) {
			y = 0;
		}

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

	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;

const double EPS=1e-8;
typedef vector<double>vec;
typedef vector<vec>mat;

/// Ax=b
vec gauss_jordan(const mat& A,const vec& b){
    int n=A.size();
    mat B(n,vec(n+1));

    for(int i=0;i<n;i++)
        for(int j=0;j<n;j++)B[i][j]=A[i][j];

    for(int i=0;i<n;i++)B[i][n]=b[i];

    for(int i=0;i<n;i++){
        int pivot=i;
        for(int j=i+1;j<n;j++){
            if(abs(B[j][i])<abs(B[pivot][i]))pivot=j;
        }
        swap(B[i],B[pivot]);
        if(abs(B[i][i])<EPS)return vec();

        for(int j=i+1;j<=n;j++)B[i][j]/=B[i][i];
        for(int j=0;j<n;j++){
            if(i==j)continue;
            for(int k=i+1;k<=n;k++)B[j][k]-=B[j][i]*B[i][k];
        }
    }

    vec x(n);
    for(int i=0;i<n;i++)x[i]=B[i][n];
    return x;
}

int main(){
    mat A(2,vec(2));
    vec b(2);
    while(true){
        for(int i=0;i<2;i++){
            if(scanf("%lf%lf%lf",&A[i][0],&A[i][1],&b[i])==EOF)return 0;
        }

        vec x=gauss_jordan(A,b);
        if(x.size()<2)return 0;
        printf("%lf %lf\n",x[0],x[1]);
    }
    return 0;
}

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

using namespace std;

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

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

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

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

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double ESP=1e-10;
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=(c-a*x)/b;
    if(
    printf("%.3f %.3f\n",x,y);
  }
  

}

C++: try :
  while True :
    (a,b,c,d,e,f) = map(int, raw_input().split())

    print "%.3f %.3f"%((c*e-b*f)/(a*e-b*d), (a*f-c*d)/(a*e-b*d))
except EOFError :
  pass

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

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

        x = x + ( 0.5 - ( x < 0 ) )/1000;
        y = y + ( 0.5 - ( y < 0 ) )/1000;
        x = int( x * 1000 );
        y = int( y * 1000 );
        if(x != 0) x /= 1000;
        if(y != 0) y /= 1000;

        cout << fixed << setprecision(3)
             << x << ' ' << y
             << endl;
    }
    return 0;
}

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