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>
using namespace std;

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

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

            d = d - a;           // d = 0
            e = e - b;
            f = f - c;

            e = e * b / e;
            f = f * b / e;

            b = b - e;            // b = 0
            c = c - f;

            a = a / a;
            c = c / a;            // x = c

            e = e / e;
            f = f / e;            // y = f

            cout << setprecision(4) << c << " " << setprecision(4) << f << endl;
      }

      return 0;
}

C++: //
//  main.cpp
//  Sample
//
//  Created by h3037183 on 2017/07/31.
//  Copyright ?? 2017??´ ?°????. All rights reserved.
//

#include <iostream>
#include<algorithm>
using namespace std;
int main(){
    double a,b,c,d,e,f,x,y;
    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<<x<<" "<<y<<endl;
    return 0;
}

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

int gcd(int g,int h){
	if(h == 0)
		return g;
	return gcd(h, g % h);
}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	int a, b, c, d, e, f;
	while(cin){
		cin >> a >> b >> c >> d >> e >> f;
		
		int g = f * b - c * e;
		int h = b * d - a * e;
		double x = (g / gcd(g, h)) / (h / gcd(g, h));
		int i = f * a - d * c;
		int j = -d * b + e * a;
		double y = (i / gcd(i, j)) / (j / gcd(i, j));
		cout << fixed << setprecision(3) << x << " " << y << endl;
	}
	return 0;
}

C++: #include<stdio.h>

int main(){

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

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

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

void func(double, int);

int main(){

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

	return 0;
}

void func(double x, int n){
	
	x *= pow(10, -n-1);
	x = round(x);
	x *= pow(10, n+1);	

}

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

C++: #include<iostream>
#include<cstdio>
#include<iomanip>
#include<vector>
#include<math.h>
using namespace std;
class SimultaneousEquation{ 
    public:
        void solve(int a,int b,int c,int d,int e,int f){ 
            double x,y;
            x=double(c*e-b*f)/(a*e-b*d);
            y=double(c*d-a*f)/(b*d-a*e);
            printf("%.3lf %.3lf\n",fabs(x),fabs(y));
            }
};
int main(){ 
    int a,b,c,d,e,f;
    SimultaneousEquation inst;
    while(cin>>a>>b>>c>>d>>e>>f){
        inst.solve(a,b,c,d,e,f);
    }
}

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

int main(){
	float a, b, c, d, e, f, x, y;
	while(cin >> a >> b >> c >> d >> e >> f){
		x = (b * f - c * e) / (b * d - a * e);
		y = (c - a * x) / b;
	}
	if(x > 0) {
		x += 0.0005;
	}
	else if(x < 0){
		x -= 0.0005;
	}
	if(y > 0){
		y += 0.0005;
	}
	else if(y < 0){
		y -= 0.0005;
	}
	cout << fixed << setprecision(3) << x << ' ' << y << endl;
	return 0;
}

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

#define REP(i, a) for(int i=0;i<(int)a;++i)
using namespace std;

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

int main() {
    solver();
    return 0;
}