Go: package main

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

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]
		var mulA, mulD int
		if a < 0 {
			mulA = a * -1
		} else {
			mulA = a
		}
		if d < 0 {
			mulD = d * -1
		} else {
			mulD = d
		}
		a *= mulD
		b *= mulD
		c *= mulD
		d *= mulA
		e *= mulA
		f *= mulA

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

		bE := b - e
		cF := c - f
		if bE == 0 {
			bE = 1
		}
		y := cF / bE
		x := (c - (y * b)) / a

		fmt.Printf("%d.000 ", x)
		fmt.Printf("%d.000\n", y)
	}
}

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;
		printf("%1.3lf %1.3lf\n", x, y);
	}
}

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

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

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

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

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

  }


  return 0;
}

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

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

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

C++: #define _CRT_SECURE_NO_WARNINGS
#include<cstdio>

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

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

int main()
{ 
	double x1, x2, y1, y2, z1, z2;
	double x, y;
	while (cin >> x1 >> y1 >> z1 >> x2 >> y2 >> z2) {
		x = x1;
		x1 *= x2; y1 *= x2; z1 *= x2;
		x2 *= x; y2 *= x; z2 *= x;
		y = (z1 - z2) / (y1 - y2);
		if (z1 - z2 == 0)y = 0;
		x = (z1 - (y1*y)) / x1;
		if (z1 - (y1*y) == 0)x = 0;
		int a, b;
		a = x * 10000;
		b = y * 10000;
		if (a % 10 > 4) {
			a += 10;
			x = double(a) / 10000;
		}
		if (b % 10 > 4) {
			b += 100;
			y = double(b) / 10000;
		}
		cout << fixed;
		cout << setprecision(3) << x << ' ' << y << endl;

	}
	return 0;
}

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

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

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

#define FOR(i,a,b) for(long long int i=(a);i<(b);i++)
#define REP(i,n) for(long long int i=0;i<(n);i++)
#define ALL(s) (s).begin(),(s).end()

#define PI 3.14159265358479

typedef long long int ll;
typedef vector<long long int> vi;

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

C++: #include <cstdio>

using namespace std;

int main() {
	while(true) {
		int a,b,c,d,e,f;
		if(scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f)<6)break;
		// adx + bdy = cd
		// adx + aey = af
		// (bd-ae)y = cd-af
		int y = (c*d-a*f)*2000/(b*d-a*e);
		// aex + bey = ce
		// bdx + bey = bf
		// (ae-bd)x = ce-bf
		int x = (c*e-b*f)*2000/(a*e-b*d);
		if(x >= 0) {
			x = (x+1)/2;
			printf("%d.%03d ",x/1000, x%1000);
		} else {
			x = (-x+1)/2;
			printf("-%d.%03d ",x/1000, x%1000);
		}
		if(y >= 0) {
			y = (y+1)/2;
			printf("%d.%03d\n",y/1000, y%1000);
		} else {
			y = (-y+1)/2;
			printf("-%d.%03d\n",y/1000, y%1000);
		}
	}
	return 0;
}

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

using namespace std;

double round(double d){
	int k = (int)(d*10000)%10;
	return (k>=5)? d-((double)k/10000)+0.001: d- ((double)k/10000);
}

int main(){
	int a, b, c, d, e, f;
	while(cin >> a >> b >> c >> d >> e >> f){
		double del = 1.0/(a*e - d*b);
		printf("%0.3f %0.3f\n", round(del*(e*c-b*f)), round(del*(a*f-d*c)));
	}
}

C++: #include <bits/stdc++.h>
#include <iostream>
#include <cstdio>
using namespace std;
#define j bai;
int main() {
	double a, b, c, d, e, y, x, f, bai;
	bool bo = false;
	while (cin >> a >> b >> c >> d >> e >> f) {
		if (a ==0 || b ==0) {
			if (a) {
				y = c / b;
				x = f / d - e*y;
			}
			else if (b) {
				x = a / c;
				y = f / e - d*x;
			}
			bo = true;
		}
		else if (d == 0 || e == 0) {
			if (d) {
				y = f / e;
				x = c / a - d*y;
			}
			else if (e) {
				x = f / d;
				y = f / e - d*x;
			}
			bo = true;
		}
		
		else if (a < d) {
			bai = d / a;
			a *= j;
			b *= j;
			c *= j;
		}
		else {
			bai = a / d;
			d *= j;
			e *= j;
			f *= j;
		}
		if (((a > 0 && d < 0) || (a < 0 && d>0)) && bo==false) {
			y = (c + f) / (b + e);
			x = (c - b*y) / a;
		}
		else if (bo == false) {
			y = (c - f) / (b - e);
			x = (c - b*y) / a;
		}
		if (x == -0.000) {
			x = abs(x);
		}
		if (y == -0.000) {
			y = abs(y);
		}
		printf("%.3f %.3f\n", x, y);
	}
	return 0;
}

C++: require("fs").readFileSync("/dev/stdin","utf8").trim().split('\n').map(function(z){i=z.split(' ');console.log(x=((i[2]*i[4]-i[1]*i[5])/(i[0]*i[4]-i[1]*i[3])).toFixed(3),((i[2]-i[0]*x)/i[1]).toFixed(3))})

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

int main()
{
    int a1, b1, c1, a2, b2, c2, d, dx, dy;
    while(cin >> a1 >> b1 >> c1 >> a2 >> b2 >> c2){
        d = a1*b2 - a2*b1;
        dx = c1*b2 - c2*b1;
        dy = a1*c2 - a2*c1;
        if(d != 0){
            cout <<fixed << setprecision(3)<< (float)dx/d<<' '<<(float)dy/d<<endl;
        }
    }
    return 0;
}

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

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

using namespace std;

int main() {

	double no[12] = { 0 }, ans[4] = { 0 };
	int i, j = 0;

	for (i = 0; i < 12; i++) {
		cin >> no[i];
	}

	for (i = 0; i < 3; i=i+2) {
		ans[i] = (no[j + 2] * no[j + 4] - no[j + 1] * no[j + 5]) / (no[j] * no[j + 4] - no[j + 1] * no[j + 3]);
		ans[i + 1] = (no[j + 3] * no[j + 2] - no[j] * no[j + 5]) / (no[j + 1] * no[j + 3] - no[j] * no[j + 4]);
			j = j + 6;
	}

	for (i = 0; i < 3; i = i + 2) {
		if (ans[i] == 0)
			ans[i] = 0;
		if (ans[i + 1] == 0)
			ans[i + 1] = 0;
		printf("%.3f %.3f\n", ans[i], ans[i + 1]);
	}

	return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#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){
		if(a!=0&&d!=0){
			y = (c/a-f/d)/(b/a-e/d);
			x = (c-b*y)/a;
		}else if(a==0&&d!=0){
			y = b/c;
			x = (f-e*y)/d;
		}else if(a!=0&&d==0){
			y = f/e;
			x = (c-b*y)/a;
		}
		printf("%4.3f %4.3f\n",x,y);
	}
}