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 x, y, a, b, c, d, e, f;

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

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

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

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

C++: #include <iostream>

int main()
{
        int a, b, c, d, e, f;
        double y;
        std::cout.precision(3);
        std::cout.setf(std::ios::fixed);
        while(std::cin >> a >> b >> c >> d >> e >> f)
        {
                if(a != 0)
                {
                        y = (f - d*c/(double)a)/(e - d*b/(double)a);
                        std::cout << (c - b*y)/a << " " << y << std::endl;
                }
                else
                {
                        y = c/(double)b;
                        std::cout << (f - e*y)/d << " " << y << std::endl;
                }
        }
        return 0;
}

C++: #include<stdio.h>
int main(){
	double a,b,c,d,e,f,bb,cc,ee,ff,x,y;
	for(;;){
		if(scanf("%lf",&a)==EOF){break;}
		scanf("%lf",&b);
		scanf("%lf",&c);
		scanf("%lf",&d);
		scanf("%lf",&e);
		scanf("%lf",&f);
		bb=b*d;
		cc=c*d;
		ee=e*a;
		ff=f*a;
		y=(cc-ff)/(bb-ee);
		x=(c-b*y)/a;
		printf("%.3lf %.3lf\n",x,y);
	}
	return 0;
}

C++: #include "bits/stdc++.h"
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-b*y) / a;
        cout << fixed << x << " " << y << endl;
    }
    return 0;
}

C++: /*************************************************************************
	> File Name: 23.cpp
	> Author: ralph
	> Mail: 1694487365@qq.com
	> Created Time: 2018年12月21日 星期五 21时32分48秒
 ************************************************************************/

#include<bits/stdc++.h>
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)!=EOF)
    {
        double ans1=(c*e-b*f)/(a*e-b*d),ans2=(a*f-c*d)/(a*e-b*d);
        printf("%.3f %.3f\n",ans1==0?0:ans1,ans2==0?0:ans2);
    }
}

C++: #include <iostream> 
#include <string> 
#include <vector> 
#include <cmath> 
#include <algorithm> 
#include <cstdlib> 
#include <ctime> 
#include <cstdio> 
#include <functional> 
#include <set> 
#include <sstream> 
#include <cctype>
#include <stack>
#include <queue>
#include <cstring>
#include <map>
 
using namespace std; 

const long long INF=1LL<<50LL;
const double PI=3.14159265358979323846264;
const double eps=1e-8;
typedef vector<double> vec;
typedef vector<vec> mat;

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;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){
				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(){

	double a,b,c,d,e,f;
	while(cin>>a>>b>>c>>d>>e>>f){
		
		mat A(2,vec(2));
		vec v(2);
		
		A[0][0]=a; A[0][1]=b;
		A[1][0]=d; A[1][1]=e;
		v[0]=c; v[1]=f;
		
		vec ans=gauss_jordan(A,v);
		printf("%.3f %.3f\n",ans[0],ans[1]);	
	}

	return 0;
}

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

#define REP(i,n) for(int i=0;i<(int)(n);++i)

int main() {
  for(;;) {
    double a, b, c, d, e, f;
    if( !(cin >> a >> b >> c >> d >> e >> f) )break;
    double det = 1.0 / (a * e -b * d);
    double x = det * (e * c - b * f);
    double y = det * (-d * c + a * f);
    double EPS = 1e-8;
    char buf[128];
    sprintf(buf, "%.4f", x + EPS);
    buf[ strlen(buf) - 1 ] = ' ';
    printf(buf);
    sprintf(buf, "%.4f", y + EPS);
    buf[ strlen(buf) - 1 ] = '\n';
    printf(buf);
  }
  return 0;
}

C++: 
#include <cmath>
#include <string>
#include <sstream>
#include <iostream>
#include <algorithm>

int main(void) 
{
    std::string str;
    double a, b, c, d, e, f;
    double x, y;

    while (getline(std::cin, str)) {
        std::istringstream str_s(str);

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

        if (c*e - b*f == 0) 
            x = 0;
        else
            x = (c*e - b*f) / (a*e - b*d);

        if (c*d - a*f == 0)
            y = 0;
        else
            y = (c*d - a*f) / (b*d - a*e);

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

        std::cout.setf(std::ios::fixed);  
        std::cout.precision(3);

        std::cout << std::showpoint << x << ' ' << y << '\n';
    }

    return 0;
}

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

int main()
{
	double A, B, C, D, E, F, X, Y, G , H;

	while(cin >> A >> B >> C >> D >> E >> F)
	{
		G = A / D;
		D *= G;
		E *= G;
		F *= G;
		Y = (F-C) / (E-B);
		
		D /= G;
		E /= G;
		F /= G;
		H = B / E;
		D *= H;
		E *= H;
		F *= H;
		X = (F-C) / (D-A);

		if(static_cast<int>(Y*100000)%100>=49 && static_cast<int>(Y*100000)%100<=50 && Y<0){
			Y += 0.0001;
		}

		if(static_cast<int>(-1*X*100000)%100>=49 && static_cast<int>(-1*X*100000)%100<=50 && X<0){
			X += 0.0001;
		}

		if(Y>-0.0005 && Y<=0.0){
			Y=0;
		}

		if(X>-0.0005 && X<=0.0){
			X=0;
		}

		cout<<fixed<<setprecision(3)<<X<<" "<<fixed<<setprecision(3)<<Y<<endl;
	}

	return 0;
}

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

double deter(double a, double b, double c, double d) {
	return a * d - b * c;
}

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

	double det;

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

		det = deter(a, b, d, e);

		printf("%.3lf ", deter(c, b, f, e) / det);
		printf("%.3lf\n", deter(a, c, d, f) / det);



		
	}

	//system("pause");
	return 0;
}

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

C++: #include <iostream>
#include <iomanip>
using namespace std;
int main( void )
{
	while ( !cin.eof() )
	{
		int a, b, c, d, e, f;
		cin >> a >> b >> c >> d >> e >> f;
		if ( cin.eof() )
			break;

		double delta = 1.0 / ( a*e - b*d );

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

		if ( x == 0.0 )
			x = 0.0;
		if ( y == 0.0 )
			y = 0.0;

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

	}

	return 0;
}