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(void){
        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-b*d);
                y=(-d*c+a*f)/(a*e-b*d);
                if(x<=1e-10 and -1*x<=1e-10)x=0;
                if(y<=1e-10 and -1*y<=1e-10)y=0;
                printf("%.3f %.3f\n",x,y);
        }
        return 0;
}

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

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

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

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

		x *= 10000;
		x = x + 0.5 - (x < 0);
		x = (int)x;
		x /= 10000;

		y *= 10000;
		y = y + 0.5 - (y < 0);
		y = (int)y;
		y /= 10000;


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

	return 0;
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
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 = (a*f - c+d)/(a*e - d*b);
    y = (c -b*y)/a;
    printf("%.3f %.3f",x,y);
  }
}

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

void solve_SE(double* x, double a, double b, double c, double d, double e, double f)
{
    x[0] = (c * e - f * b) / (a * e - d * b);
    x[1] = (c * d - f * a) / (b * d - e * a);
}

int main()
{
    double a, b, c, d, e, f;
    double x[2];
    while (cin >> a >> b >> c >> d >> e >> f) {
        solve_SE(&x[0], a, b, c, d, e, f);
        for (int i = 0; i < 2; i++) {
            x[i] *= 1000;
            if (x[i] > 0)
                x[i] += 0.5;
            else
                x[i] -= 0.5;
            x[i] = static_cast<int>(x[i]) / 1000;
        }
        cout << fixed << setprecision(3) << x[0] << ' ' << x[1] << endl;
    }
}

C++: /* -*- coding:utf-8 -*- */

#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <cmath>

using namespace std;

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


  while(cin >> a >> b >> c >> d >> e >> f, !cin.eof()) {
    cout << "\n";
    double x,y;
    x = (e*c-b*f)/(a*e-b*d);
    y = (-c*d+a*f)/(a*e-b*d);
    cout << fixed << setprecision(3) << showpoint << ((fabs(x) < 1e-4) ? 0 : x) << ' ' << ((fabs(y) < 1e-4) ? 0 : y) << endl;
  }
  return 0;
}

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

int main()
{
	double a[6], x, y;

	while(cin>>a[0]){
		for(int i = 1; i < 6; i++){
			cin>>a[i];
		}
		y = (a[2]*a[3]-a[0]*a[5])/(a[1]*a[3]-a[0]*a[4]);
		x = (a[2]-a[1]*y)/a[0];


		if(x >= 0) x = ((double)((int)(x*1000+0.5)))/1000;
		else x = ((double)((int)(x*1000-0.5)))/1000;
		if(y >= 0) y = ((double)((int)(y*1000+0.5)))/1000;
		else y = ((double)((int)(y*1000-0.5)))/1000;

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

C++: #include <bits/stdc++.h>
//#include "bits/stdc++.h"

#define rep(i,n) for(ll (i)=0;(i)<(ll)(n);(i)++)
#define all(x) (x).begin(),(x).end()
#define MOD 1000000007LL
#define INF (1LL<<60LL)
#define int long long
typedef long long ll;

using namespace std;



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

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){
	double ta=a;
	double tb=b;
	double tc=c;
	
	a*=d;
	b*=d;
	c*=d;
	d*=ta;
	e*=ta;
	f*=ta;
	if((b-d)==0)
		y=0;
	else{
		y=(c-f)/(b-e);
	}
	x=(tc-(tb*y))/ta;

	cout << x << " " << y << endl;
	}
	
    return 0;
}

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

using namespace std;

int main(){
  double a,b,c,d,e,f;
  vector<double> out;
  while (cin>>a>>b>>c>>d>>e>>f){
    out.push_back((c*e-b*f)/(a*e-b*d));
    out.push_back((c*d-a*f)/(b*d-a*e));
  }
  for (int i=0;i<out.size();i+=2){
    if (out[i]==0) out[i]=0;
    if (out[i+1]==0) out[i+1]=0;
    printf("%.3f %.3f\n",round(out[i]*1000)/1000.0,round(out[i+1]*1000)/1000.0);
  }
  return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

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

C++: 
#include<stdio.h>

int main (void){

    int a,b,c,d,e,f;

    double X,Y;

    while(scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f) != EOF){

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

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

        printf("%.3lf %.3lf\n",X ,Y);
    }

    return 0;
}

C++: #include <stdio.h>

using namespace std;


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

	while(scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f)!=EOF){
		if(c*e==b*f){
			x=0;
		}else{
			x=(c*e-b*f)/(a*e-d*b);
		}

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

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

    return 0;
}

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

using namespace std;

int main()
{
    float a,b,c,d,e,f,x,y;
    while(cin>>a>>b>>c>>d>>e>>f){
       x=(c*e-f*b)/(a*e-b*d);
       y=(a*f-d*c)/(a*e-b*d);
       cout<<x<<" "<<y<<endl;                          
    }
}

C++: #include <iostream>
#include <cstdio>
#include <cmath>
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 - b*f)/(a*e - b*d);
      y = (c*d - a*f)/(b*d - a*e);
  
      if(abs(x) < 0.001) x = 0;
      if(abs(y) < 0.001) y = 0;
      printf("%.3f %.3f",x,y);
      
    }
    return 0;
}

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

#define REP(i,n) for(int i=0;i<(int)(n);++i)

int main() {
  for(;;) {
    double a, b, c, d, e, f;
    if( !(cin >> a >> b >> c >> d >> e >> f) )break;
    double det = 1.0 / (-b * d + a * e);
    double x = det * (e * c - b * f);
    double y = det * (-d * c + a * f);
    if( x > y ) swap( x, y );
    double EPS = 1e-8;
    printf("%.3f %.3f\n", x + EPS, y + EPS);
    
  }
  return 0;
}

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

int main(){

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

    return 0;
}