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<iomanip>

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

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

int main(){
  int i;
  float x[6];
  int y1, y2, re1, re2;

  while(cin >> x[0]){
    for(i=1; i<6; i++){
      cin >> x[i];
    }

    //normalize
    x[1]/=x[0]; x[2]/=x[1]; x[0]=1;

    //subtraction
    x[4]-=x[3]*x[1]; x[5]-=x[3]*x[2]; x[3]=0;

    //normalize
    x[5]/=x[4]; x[4]=1;

    //subtraction
    x[2]-=x[1]*x[5]; x[1]=0;

    y1=(int)x[2]*10000; y2=(int)x[5]*10000;
    re1=y1%10; re2=y2%10;
    if(re1>4) y1-=re1;
    else y1+=10-re1;
    if(re2>4) y2-=re2;
    else y2+=10-re2;
    printf("%f %f\n", (float)y1/10000.0f, (float)y2/10000.0f);
  }

  return 0;
}

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

using namespace std;

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

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

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

		if(x == -0)
			x = abs((int)x);
		if(y == -0)
			y *=abs((int)y);
		cout << fixed << setprecision(3);
		cout << x << ' ' << y << endl;
		cout << setprecision(6); // 標準の6桁に戻す
	}

	return 0;
}

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

int main()
{
  for (double a, b, c, d, e, f;
       cin >> a >> b >> c >> d >> e >> f;
       ) {
    double x = (c*e - f*b) / (a*e - d*b);
    double y = (c - a*x) / b;
    if (abs(x) < 1e-10) x = 0;
    if (abs(y) < 1e-10) y = 0;
    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, G , H;

	while(cin >> A >> B >> C >> D >> E >> F)
	{
		G = A / D;
		D *= G;
		E *= G;
		F *= G;
		Y = (F-C) / (E-B);
		
		D /= G;
		E /= G;
		F /= G;
		H = B / E;
		D *= H;
		E *= H;
		F *= H;
		X = (F-C) / (D-A);

		if(static_cast<int>(Y*100000)%100>=49 && static_cast<int>(Y*100000)%100<=50 && Y<0){
			Y += 0.000001;
		}

		if(static_cast<int>(-1*X*100000)%100>=49 && static_cast<int>(-1*X*100000)%100<=50 && X<0){
			X += 0.000001;
		}

		if(Y>-0.0005 && Y<=0.0){
			Y=0;
		}

		if(X>-0.0005 && X<=0.0){
			X=0;
		}

		cout<<fixed<<setprecision(3)<<X<<" "<<fixed<<setprecision(3)<<Y<<endl;
	}

	return 0;
}

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

int main(void)
{
	double a[6], acopy, x , y;
	int i, ansx, ansy;
	
	while (scanf ("%lf %lf %lf %lf %lf %lf", &a[0], &a[1], &a[2], &a[3], &a[4], &a[5])!= EOF){
		acopy = a[1];
		for (i = 0; i < 3; i++)
		{
			a[i] *= a[4];
		}
		for (i = 3; i < 6; i++)
		{
			a[i] *= acopy;
		}
		a[0] -= a[3];
		if (a[0] == 0) x = 0;
		else {
			a[2] -= a[5];
			x = a[2] / a[0];
		}
		acopy = a[5] - (a[3] * x);
		y = acopy / a[4];
		if (x == -0) x = abs(x);
		if (y == -0) y = abs(y);
		ansx = 10000 * x;
		ansy = 10000 * y;
		if (ansx % 10 > 4) x += 0.001;
		if (ansy % 10 > 4) y += 0.001;
		printf("%.3f %.3f\n", x, y);
	}
	
	return (0);
}

C++: #include <bits/stdc++.h>	//C++標準ライブラリ一括読み込み
using namespace std;

// ax+by=c
// dx+ey=f
double unko(double x){
	int y=int(round(x*1000));
	return double(y/1000);
}

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

C++: #include <bits/stdc++.h>
using namespace std;
#define FOR(i, n) for(int i = 0; i < (n); i++)
#define MEM(a, x) memset(a, x, sizeof(a))
#define ALL(a) a.begin(), a.end()
#define UNIQUE(a) a.erase(unique(ALL(a)), a.end())
typedef long long ll;

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

int main(int argc, char const *argv[]) {
	ios_base::sync_with_stdio(false);
	while (cin >> a >> b >> c >> d >> e >> f) {
		printf("%.4lf%.4lf\n", (e*c-f*b)/(e*a-b*d), (d*c-a*f)/(d*b-a*e));
	}
	
	return 0;
}

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

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

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

C++: #include <cstdio>

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

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

double abs2(const double n){
	if (n < 0) return -(n);
	return n;
}

int main(){
	double a, b, c, d, e, f;
	double x, y;
	double A, B, C;
	const double p = 0.00000001;

	while (cin >> a >> b >> c >> d >> e >> f){
		A = (a*e) - (b*d);
		B = (c*e) - (b*f);
		C = (a*f) - (c*d);

		x = B / A;
		y = C / A;
		
		if (abs2(x) < p) x = 0;
		if (abs2(y) < p) y = 0;

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

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

int main()
{
	double 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 = (b*c*d-a*c*e-a*b*f+a*c*e)/(b*b*d-a*b*e);
		cout << fixed << setprecision(3) << x << " "  << y <<endl;
	}
	
	return 0;
}

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

using namespace std;

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

  while (cin >> a >> b >> c >> d >> e >> f) {
    double x, y;
    x = (e * c - b * f) / (a * e - b * d);
    y = (a * f - d * c) / (a * e - b * d);

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

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

using namespace std;

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

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

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

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

return 0;
}