Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func gcd(num1, num2 int) int {
	if num2 == 0 {
		return num1
	}
	num3 := num1 % num2
	return gcd(num2, num3)
}

func lcm(num1, num2 int) int {
	if num1%num2 != 0 {
		num3 := gcd(num1, num2)
		for i := 1; ; i++ {
			check := num3 * i
			if check%num1 == 0 && check%num2 == 0 {
				return check
			}
		}
	} else {
		return num1
	}
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	for scanner.Scan() {
		strNums := strings.Fields(scanner.Text())
		nums := []int{}
		for _, strNum := range strNums {
			num, _ := strconv.Atoi(strNum)
			nums = append(nums, num)
		}
		a := nums[0]
		b := nums[1]
		c := nums[2]
		d := nums[3]
		e := nums[4]
		f := nums[5]
		lcm := lcm(a, d)
		mulA := lcm / a
		mulD := lcm / d
		a *= mulA
		b *= mulA
		c *= mulA
		d *= mulD
		e *= mulD
		f *= mulD

		if d < 0 {
			d *= -1
			e *= -1
			f *= -1
		}

		bE := b - e
		cF := c - f
		y := float64(cF) / float64(bE)
		x := (float64(c) - (y * float64(b))) / float64(a)

		if x == 0 {
			fmt.Printf("%.3f ", 0.0)
		} else {
			fmt.Printf("%.3f ", x)
		}
		if y == 0 {
			fmt.Printf("%.3f\n", 0.0)
		} else {
			fmt.Printf("%.3f\n", y)
		}
	}
}

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

#define MAX 256

int main(void){

	double a = 0, b = 0, c = 0, d = 0, e = 0, f = 0;
	double ansx[MAX], ansy[MAX];

	for (int i = 0; i < MAX; i++){
		ansx[i] = 0;
		ansy[i] = 0;
	}


	int i = 0;

	while (scanf("%lf%lf%lf%lf%lf%lf%lf", &a,&b,&c,&d,&e,&f) != EOF){
		ansx[i] = (c*e - b*f) / (a*e - b*d);
		ansy[i] = (c*d - a*f) / (b*d - a*e);
		i++;
	}

	for (int j = 0; j < i; j++){
		printf("%.3lf %.3lf\n", ansx[j], ansy[j]);
	}

	return 0;
}

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

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

using namespace std;

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

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

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

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

		if(cin.eof()){
			break;
		}

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

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

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

	return 0;
}

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

using namespace std;

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

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

	x *= 1000;
	y *= 1000;
	x = int(x);
	y= int(y);
	x = x / 1000;
	y = y / 1000;
 	
 	printf("%.3lf %.3lf\n",x,y);
	}
 return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int b,a,e,d,f,i,c;
	float y,x;
	while(scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f)!=EOF)  {
			y=(c*d-a*f)/(b*d-a*e);
			x=(c-(b*y))/a;
		if(x<=0.0000 && x>-0.0005){
			x=0;
		}
		if(y<=0.000&&y>-0.0005){
			y=0;
		}	
		printf("%.3f %.3f\n",x,y);
	}
	return 0;
}

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

using _i64 = int64_t;
using _u64 = uint64_t;
using _f64 = double;

#define _for(i, start, end) for(_i64 i = (_i64)start; i < (_i64)end; ++i)
#define _rep(i, number) _for(i, 0, number)
#define _foreach(e, data) for(auto& e : data)
#define _all(data) data.begin(), data.end()

template<typename type>
_i64 _size(const type& data) { return static_cast<_i64>(data.size()); }
template<typename type, size_t size>
_i64 _size(const type (&)[size]) { return static_cast<_i64>(size); }

enum _flag : bool { able = true, disable = false };

struct _time {
    _time(_flag flag) { check = flag; if(!check) { return; } gettime(start); }
    ~_time() {
        if(!check) { return; }; gettime(end);
        _i64 elapse = chrono::duration_cast<chrono::milliseconds>(end - start).count();
        cout << endl << "Time: " << elapse << " ms" << endl;
    }
    private:
    using _timer = chrono::time_point<chrono::system_clock>;
    _timer start, end; bool check;
    void gettime(_timer& time) { time = chrono::system_clock::now(); }
};

struct _ini { _ini() { ios::sync_with_stdio(false); cin.tie(nullptr); } } _ini;

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

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

#define MAX 256

int main(void){

	float a, b, c, d, e, f;
	float ansx[MAX], ansy[MAX];

	int i = 0;

	while (scanf("%f%f%f%f%f%f%f", &a,&b,&c,&d,&e,&f) != EOF){
		if (a*e != b*d){
			ansx[i] = (c*e - b*f) / (a*e - b*d);
			ansy[i] = (c*d - a*f) / (b*d - a*e);
			if (((int)(ansx[i] * 10000) % 10) > 4 || ((int)(ansx[i] * 10000) % 10) < -4){
				ansx[i] += 0.001;
			}
			if (((int)(ansy[i] * 10000) % 10) > 4 || ((int)(ansx[i] * 10000) % 10) < -4){
				ansy[i] += 0.001;
			}
		}
		i++;
	}

	for (int j = 0; j < i; j++){
		printf("%.3f %.3f\n", ansx[j], ansy[j]);
	}
	
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<stdio.h>
using namespace std;
int main() {
	double a, b, c, d, e, f, x, y;
	while (!cin.eof()){
		cin >> a >> b >> c >> d >> e >> f;
		a *= e;
		c *= e;
		d *= b;
		f *= b;
		b *= e;
		e = b;
		if (c >= f) {
			x = (c - f) / (a - d);
		}
		else x = (f - c) / (d - a);
		y = (c - a*x) / b;
		if (x < 10){
			if (y < 10)
				printf("%1.3lf %1.3lf\n", x, y);
			else if (y < 100)
				printf("%1.3lf %2.3lf\n", x, y);
			else if (y < 1000)
				printf("%1.3lf %3.3lf\n", x, y);
		}
		else if (x < 100) {
			if (y < 10)
				printf("%1.3lf %1.3lf\n", x, y);
			else if (y < 100)
				printf("%2.3lf %2.3lf\n", x, y);
			else if (y < 1000)
				printf("%3.3lf %3.3lf\n", x, y);
		}
		else if (x < 1000)
		{
			if (y < 10)
				printf("%1.3lf %1.3lf\n", x, y);
			else if (y < 100)
				printf("%2.3lf %2.3lf\n", x, y);
			else if (y < 1000)
				printf("%3.3lf %3.3lf\n", x, y);
		}
	}
}

C++: #include <iostream>
#include <cstdio>
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", x, y);
  }
  return 0;
}

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

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

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

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

	cout << showpoint << setprecision(3);
	cout << setiosflags( ios::fixed );
	cout << ( x == -0.0 ? 0.0 : x ) << " " << ( y == -0.0 ? 0.0 : y ) << endl;
}

C++: #include <iostream>
#include <iomanip>
using namespace std;
int main() {
int a,b,c,d,e,f;
while (cin>>a>>b>>c>>d>>e>>f) {
 double Dx = c*e-b*f;
 double Dy = a*f-c*d;
 double D  = a*e-b*d;
 cout << fixed << setprecision(4) << Dx/D << ' ' << Dy/D << endl;
 }
return 0;
}