Go: package main

import (
        "fmt"
        "bufio"
        "os"
)

func main() {
        var a, b, c, d, e, f float64
        sc := bufio.NewScanner(os.Stdin)
        for sc.Scan() {
                fmt.Sscanf(sc.Text(), "%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f)

                det := a*e - b*d
                x := (e*c - b*f) / det
                y := (a*f - c*d) / det
                fmt.Printf("%04f %04f\n", x, y)
        }
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#define N 2
 
using namespace std;
typedef vector< vector<double> > Equation;
 
bool input(Equation& c)
{
	if (cin.eof()) return false;

    for (int i = 0; i < N; ++i)
        for (int j = 0; j < N + 1; ++j)
            cin >> c[i][j];
 
    return true;
}
 
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
 
    Equation c(N, vector<double>(N + 1));
    while (input(c))
    {
		// Gaussian elimination
		// 1. Forward elimination
        for (int i = 0; i < N - 1; ++i)
            for (int j = i + 1; j < N; ++j)
            {
                double d = c[j][i] / c[i][i];
                for (int k = i + 1; k <= N; ++k)
                    c[j][k] -= c[i][k] * d;
            }
 
		// 2. Back substitution
        for (int i = N - 1; i >= 0; --i)
        {
            double d = c[i][N];
            for (int j = i + 1; j < N; ++j)
                d -= c[i][j] * c[j][N];
            c[i][N] = d / c[i][i];
        }
 
        cout << setprecision(4) << fixed << c[0][N];
        for (int i = 1; i < N; ++i)
            cout << " " << c[i][N];
        cout << endl;
    }
 
    return 0;
}

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

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

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

	return 0;
}

C++: #include <iostream>
#include <math.h>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#define REP(i,n) for(int i=0;i<n;i++)
typedef long long ll;

using namespace std;
int kaijo(int n){
	int ans = 1;
	if (n != 0){
		for (int i = 0; i < n; i++){
			ans *= (n - i);
		}
	}
	else{
		ans = 1;
	}
	return ans;
}

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);
		cout << fixed << setprecision(3) << x << " " << fixed << setprecision(3) << y << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<stdio.h>
using namespace std;
int main(){
	int a,b,c,d,e,f;
	int o,p,q,r,s,t;
	float x,y;
	for(int i=0;i<2;i++){
		scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f);
		o=a;p=b;q=c;r=d;s=e;t=f;
		o*=d;p*=d;q*=d;
		r*=a;s*=a;t*=a;
		//printf("%d %d %d %d %d %d \n",o,p,q,r,s,t);
		p-=s;
		q-=t;
		y=(float)(q/p);
		int g=(int)(e*y);
		g*=-1;
		x=(float)((f+g)/d);
		printf("%.3f %.3f",x,y);
	}
}

C++: #include<cstdio>
int main(void)
{
	int a,b,c,d,e,f;
	float x,y;
	while(scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f)!=EOF)
	{
		y=(a*f-d*c)/((-d)*b+a*e);
		x=(c-b*y)/a;
		printf("%.3f %.3f\n",x,y);
	}
	return 0;
}
/*
ax=c-by
->x=(c-by)/a
d((c-by)/a)+ey=f
(dc-dby)/a+ey=f
(dc-dby)+aey=af
-dby+aey=af-dc
y(-db+ae)=af-dc
->y=(af-dc)/(-db+ae)
*/

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

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

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

C++: #include <stdio.h>

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

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

using namespace std;

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

	while(cin >> a >> b >> c >> d >> e >> f){
			delta = (a * e) - (b * d);

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

			if(x * 10000 >= 5){
				x += 0.001;
			}if(y * 10000 >= 5){
				y += 0.001;
			}

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

	return 0;
}

C++: #include <bits/stdc++.h>
#include <vector>
using namespace std;
double a, b, c, d, e, f, x, y;
int main(){
	while(cin >> a >> b >> c >> d >> e >> f){
		x = (c*e - b*f)/(e*a - b*d);
		y = (c*d - a*f)/(d*b - a*e);
		if(x == -0)
			x = 0;
		if(y == -0)
			y = 0;
		cout << fixed << setprecision(3) << x << " " << y << "\n";
	}
	return 0;
}

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

{
    int a,b,c,d,e,f;
    while(~scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f))
    {
        
        float x=(c*e-b*f)/(a*e-b*f);
        float y=(c*d-a*f)/(b*d-a*e);
        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, x, y;

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

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

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

	return 0;
}

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

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

C++: #include<iostream>
#include<vector>
#include<cmath>
#include<algorithm>
#include<string>
int gcd(int a, int b) {
	int num;//?????§??¬?´???°
	for (int i = std::min(a, b); i >= 0; --i) {
		if (a%i == 0 && b%i == 0) { num = i; break; }
	}
	return a*b / num;
}
int main() {
	double a, b, c,d,e,f;
	double x, y;
	while (std::cin >> a >> b >> c >> d >> e >> f) {
		y = (c*gcd(a, d) / a - f*gcd(a, d) / d) / (gcd(a, d) / a*b - gcd(a, d) / d*e);
		y *= 1000; y = std::round(y); y /= 1000;
		x = (c - b*y) / a;
		x *= 1000; x = std::round(x); x /= 1000;
		std::cout << x << " " << y << std::endl;
	}
	return 0;
}

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

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

	return 0;
}