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>
using namespace std;
int main() {
	long double a, b, c, d, e, f, x, y;
	while (cin >> a >> b >> c >> d >> e >> f) {
		x = (long double)(b*f - e * c) / (d*b - a * e);
		y = (long double)(a*f - d * c) / (a*e - d * b);
		if (x < 0)
			x = (long double)((int)(x * 1000 - 0.5)) / 1000;
		else
			x = (long double)((int)(x * 1000 + 0.5)) / 1000;
		if (y < 0)
			y = (long double)((int)(y * 1000 - 0.5)) / 1000;
		else
			y = (long double)((int)(y * 1000 + 0.5)) / 1000;
		printf("%.3llf %.3llf\n", x, y);
	}
	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) != EOF){
    double ans1 = (double)(e*c-b*f)/(double)(a*e-b*d);
    double ans2 = (double)(-d*c+a*f)/(double)(a*e-b*d); 
    printf("%.3lf %.3lf\n", ans1, ans2);
  }
  return 0;
}

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

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

#define EPS 1.0e-6

int main(){
	int a, b, c, d, e, f;
	while(cin>>a>>b>>c>>d>>e>>f){
		double x = 1.0*(e*c-b*f)/(e*a-b*d);
		double y = 1.0*(d*c-a*f)/(d*b-a*e);
		x += EPS;
		y += EPS;
		printf("%.3f %.3f", x, y);
		cout<<endl;
	}
	return 0;
}

C++: #include<cstdio>
#include<algorithm>
#include<cmath>

using namespace std;

int main(){
        double a, b, c, d, e, f, g, h, i, j, k, l, m, n, x, y;

        while(scanf("%lf%lf%lf%lf%lf%lf", &a, &b, &c, &d, &e, &f) != EOF){
                g = a * d;      //公倍数
                j = b;
                k = c;
                l = a;
                b *= g / a;
                c *= g / a;
                e *= g / d;
                f *= g / d;
                a *= g / a;
                d *= g / d;

                h = b - e;
                i = c - f;

                y = i / h;
                x = k - y * j;
                x /= l;
                y *= 1000;
                y = floor(y + 0.5);
                y /= 1000;
                x *= 1000;
                x = floor(x + 0.5);
                x /= 1000;

                printf("%.%df %.3f", x, y);
        }

        return 0;
}

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

int main(void)
{
	float a = 0;
	float b = 0;
	float c = 0;
	float d = 0;
	float e = 0;
	float f = 0;

	float x = 0;
	float y = 0;

	while (std::cin >> a >> b >> c >> d >> e >> f)
	{
		float tmp_a = a * e;
		float tmp_c = c * e;
		float tmp_d = d * b;
		float tmp_f = f * b;

		if (tmp_c == tmp_f)
		{
			x = 0;
		}
		else
		{
			x = (tmp_c - tmp_f) / (tmp_a - tmp_d);
		}

		float tmp_b = b * d;
		tmp_c = c * d;
		float tmp_e = e * a;
		tmp_f = f * a;

		if (tmp_c == tmp_f)
		{
			x = 0;
		}
		else
		{
			y = (tmp_c - tmp_f) / (tmp_b - tmp_e);
		}

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

	return 0;
}

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

int main(int argc, const char *argv[]) {
    double a, b, c, d, e, f, x, y, det;
    for ( ; std::cin >> a >> b >> c >> d >> e >> f; ) {
        det = a * e - b * d;
        x = (e * c - b * f) / det;
        y = (a * f - d * c) / det;
        if (-0.0005 < x && x < 0.0005) x = 0.0001;
        if (-0.0005 < y && y < 0.0005) y = 0.0001;
        std::cout << std::fixed << std::setprecision(3) << x << " " << y << std::endl;
    }
    return 0;
}

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

int main(){

int i;
double a[6];
double x,y;

while(scanf("%lf",&a[0])!=EOF){

for(i=1;i<6;i++)scanf("%lf",&a[i]);

x = (a[4]*a[2]-a[5]*a[1])/(a[4]*a[0]-a[3]*a[1]);

if(x==0) x=abs(x);

y = (a[3]*a[2]-a[5]*a[0])/(a[3]*a[1]-a[4]*a[0]);

if(y==0) y=abs(y);

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;
	while (cin >> a >> b >> c >> d >> e >> f)
	{
		/*if (a == 0)
		{
			double x = (c * f - b * e) / d;
			double y = b / c;
			printf("%.3f %.3f\n", x, y);
		}
		else*/
		{
			double x = (c / a) - (a * b * f - b * c * d) / (a * a * e - a * b * d);
			double y = (a * f - c * d) / (a * e - b * d);
			printf("%.3f %.3f\n", x, y);
		}
	}

	return 0;
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>	// require sort next_permutation count __gcd reverse etc.
#include <cstdlib>	// require abs exit atof atoi 
#include <cstdio>		// require scanf printf
#include <functional>
#include <numeric>	// require accumulate
#include <cmath>		// require fabs
#include <climits>
#include <limits>
#include <cfloat>
#include <iomanip>	// require setw
#include <sstream>	// require stringstream 
#include <cstring>	// require memset
#include <cctype>		// require tolower, toupper
#include <fstream>	// require freopen
#include <ctime>		// require srand
#define rep(i,n) for(int i=0;i<(n);i++)
#define ALL(A) A.begin(), A.end()
#define EPS 1e-9
using namespace std;

typedef long long ll;
typedef pair<int, int> P;

int main()
{
//	cut here before submit 
//	freopen ("testcase.SE", "r", stdin );
	string str = "";
	while (getline (cin, str ) ){
		stringstream ss (str );
		int a, b, c, d, e, f;
		ss >> a >> b >> c >> d >> e >> f;
		double x = 0.0, y = 0.0;
		x = (double)(c*e - b*f)/(double)(a*e - b*d);
		y = (double)(c*d - a*f)/(double)(b*d - a*e);

		if (fabs(x) < 1.0e-3){
			x = 0.0;
		} // end if
		if (fabs(y) < 1.0e-3){
			y = 0.0;
		} // end if

		printf ("%.3f %.3f\n", x, y );
	} // end while
		
	return 0;
}

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

using namespace std;

double s( double v, int pr ){
    double    r;
    char    b[256] = {'\0'};
    char    *p;
    sprintf( b, "%.*f", pr, v);
    r = strtod( b, &p );
    return r;
}

int main(void){
  double a,b,c,d,e,f,g,h;
  cin >> a >> b >> c >> d >> e >> f;
  while(!cin.eof()){
  g = (c*e-f*b)/(a*e-d*b);
  h = (a*f-d*c)/(a*e-d*b);
  g = s(g,3);
  h = s(h,3);
  printf("%.3f %.3f\n",g,h);
  cin >> a >> b >> c >> d >> e >> f;
  }
  return 0;
}