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>
 
using namespace std;
 
int main()
{
    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 %.3f\n", s, t);
    }
     
    return 0;
}

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

#define EPS 1.0e-6

int main(){
	int a, b, c, d, e, f;
	while(cin>>a>>b>>c>>d>>e>>f){
		double x = 1.0*(e*c-b*f)/(e*a-b*d);
		double y = 1.0*(d*c-a*f)/(d*b-a*e);
		x += EPS;
		y += EPS;
		printf("%.3f %.3f", x, y);
		cout<<endl;
	}
	return 0;
}

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

using namespace std;

int main(){
        double a, b, c, d, e, f, g, h, i, j, k, l, m, n, x, y;

        while(scanf("%lf%lf%lf%lf%lf%lf", &a, &b, &c, &d, &e, &f) != EOF){
                g = a * d;      //公倍数
                j = b;
                k = c;
                l = a;
                b *= g / a;
                c *= g / a;
                e *= g / d;
                f *= g / d;
                a *= g / a;
                d *= g / d;

                h = b - e;
                i = c - f;

                y = i / h;
                x = k - y * j;
                x /= l;
                y *= 1000;
                y = floor(y + 0.5);
                y /= 1000;
                x *= 1000;
                x = floor(x + 0.5);
                x /= 1000;

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

        return 0;
}

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

int main(void)
{
	float a = 0;
	float b = 0;
	float c = 0;
	float d = 0;
	float e = 0;
	float f = 0;

	float x = 0;
	float y = 0;

	while (std::cin >> a >> b >> c >> d >> e >> f)
	{
		float tmp_a = a * e;
		float tmp_c = c * e;
		float tmp_d = d * b;
		float tmp_f = f * b;

		if (tmp_c == tmp_f)
		{
			x = 0;
		}
		else
		{
			x = (tmp_c - tmp_f) / (tmp_a - tmp_d);
		}

		float tmp_b = b * d;
		tmp_c = c * d;
		float tmp_e = e * a;
		tmp_f = f * a;

		if (tmp_c == tmp_f)
		{
			x = 0;
		}
		else
		{
			y = (tmp_c - tmp_f) / (tmp_b - tmp_e);
		}

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

	return 0;
}

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

int main(int argc, const char *argv[]) {
    double a, b, c, d, e, f, x, y, det;
    for ( ; std::cin >> a >> b >> c >> d >> e >> f; ) {
        det = a * e - b * d;
        x = (e * c - b * f) / det;
        y = (a * f - d * c) / det;
        if (-0.0005 < x && x < 0.0005) x = 0.0001;
        if (-0.0005 < y && y < 0.0005) y = 0.0001;
        std::cout << std::fixed << std::setprecision(3) << x << " " << y << std::endl;
    }
    return 0;
}

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

int main(){

int i;
double a[6];
double x,y;

while(scanf("%lf",&a[0])!=EOF){

for(i=1;i<6;i++)scanf("%lf",&a[i]);

x = (a[4]*a[2]-a[5]*a[1])/(a[4]*a[0]-a[3]*a[1]);

if(x==0) x=abs(x);

y = (a[3]*a[2]-a[5]*a[0])/(a[3]*a[1]-a[4]*a[0]);

if(y==0) y=abs(y);

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

}

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)
	{
		/*if (a == 0)
		{
			double x = (c * f - b * e) / d;
			double y = b / c;
			printf("%.3f %.3f\n", x, y);
		}
		else*/
		{
			double x = (c / a) - (a * b * f - b * c * d) / (a * a * e - a * b * d);
			double y = (a * f - c * d) / (a * e - b * d);
			printf("%.3f %.3f\n", x, y);
		}
	}

	return 0;
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>	// require sort next_permutation count __gcd reverse etc.
#include <cstdlib>	// require abs exit atof atoi 
#include <cstdio>		// require scanf printf
#include <functional>
#include <numeric>	// require accumulate
#include <cmath>		// require fabs
#include <climits>
#include <limits>
#include <cfloat>
#include <iomanip>	// require setw
#include <sstream>	// require stringstream 
#include <cstring>	// require memset
#include <cctype>		// require tolower, toupper
#include <fstream>	// require freopen
#include <ctime>		// require srand
#define rep(i,n) for(int i=0;i<(n);i++)
#define ALL(A) A.begin(), A.end()
#define EPS 1e-9
using namespace std;

typedef long long ll;
typedef pair<int, int> P;

int main()
{
//	cut here before submit 
//	freopen ("testcase.SE", "r", stdin );
	string str = "";
	while (getline (cin, str ) ){
		stringstream ss (str );
		int a, b, c, d, e, f;
		ss >> a >> b >> c >> d >> e >> f;
		double x = 0.0, y = 0.0;
		x = (double)(c*e - b*f)/(double)(a*e - b*d);
		y = (double)(c*d - a*f)/(double)(b*d - a*e);

		if (fabs(x) < 1.0e-3){
			x = 0.0;
		} // end if
		if (fabs(y) < 1.0e-3){
			y = 0.0;
		} // end if

		printf ("%.3f %.3f\n", x, y );
	} // end while
		
	return 0;
}

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

using namespace std;

double s( double v, int pr ){
    double    r;
    char    b[256] = {'\0'};
    char    *p;
    sprintf( b, "%.*f", pr, v);
    r = strtod( b, &p );
    return r;
}

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

C++: #include <bits/stdc++.h>
#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define itrep(i,x) for(auto i=(x).begin(); i!=(x).end();i++)
#define Sort(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define vi vector<int>
#define INF (int)1e9
#define INFL 1e18
#define MOD 1000000007
#define pb push_back
#define MP make_pair
#define PI 3.1415926535
typedef long long int ll;
typedef std::pair<int,int> P;
int D=1;
int dx[4]={0,1,0,-1},dy[4]={-1,0,1,0};

using namespace std;

double set(double x){
    x*=10000.0;
    if((int)x%10>=5){
        x+=10.0;
    }
    x/=10000.0;
    
    return x;
}

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

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

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

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

    return 0;
}

C++: #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;

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

C++: #include <iostream>
#include <cstdio>
using namespace std;
int main(void){
	
	double x, y;
	int a, b, p;
	int c, d, q;

	while (cin >> a >> b >> p >> c >> d >> q){

		x = (double)((p * d - b * q) / (a * d - b * c));
		y = (double)((a * q - p * c) / (a * d - b * c));
		if (x == 0)x = 0;
		if (y == 0)y = 0;
		printf("%.3f %.3f\n", x, y);
	}
}