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<cstdio>
#include<cmath>

using namespace std;

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

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

C++: #include<stdio.h>
#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){

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

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

}

C++: #include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <sstream>
#include <typeinfo>

using namespace std;

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

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

double nth_round(double value, int n) {
    double scale = pow(10, n - 1);
    return std::round(value * scale) / scale;
}

int main() {
    double a, b, c, d, e, f;
    double coef;
    
    while (std::cin >> a >> b >> c >> d >> e >> f) {
        coef = 1. / (a * e - b * d);
        std::cout << std::setprecision(3)
                  << std::fixed
                  << nth_round(coef * (c * e - b * f), 4) << " "
                  << nth_round(coef * (a * f - c * d), 4) << std::endl;
    }

    return 0;
}

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

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

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

C++: #include <cstdio>
void calc(int x1, int y1, int a, int x2, int y2, int b)
{
	double d1 = x2;
	double d2 = x1;
	double xx1 = d1 * x1;
	double xy1 = d1 * y1;
	double a1 = d1 * a;
	double xx2 = d2 * x2;
	double xy2 = d2 * y2;
	double b1 = d2 * b;
	double y = xy1 - xy2;
	double c = a1 - b1;
	y = c / y;


	d1 = y2;
	d2 = y1;
	xx1 = d1 * x1;
	xy1 = d1 * y1;
	a1 = d1 * a;
	xx2 = d2 * x2;
	xy2 = d2 * y2;
	b1 = d2 * b;
	double x = xx1 - xx2;
	c = a1 - b1;
	x = c / x;
	if (x == 0)
	{
		x = 0;
	}
	if (y == 0)
	{
		y = 0;
	}
	printf("%.3lf %.3lf\n", x, y);
}
int main(int argc, char const *argv[])
{
	int x1, y1, a, x2, y2, b;

	while(scanf("%d %d %d %d %d %d", &x1, &y1, &a, &x2, &y2, &b) != EOF)
	{
		calc(x1, y1, a, x2, y2, b);
	}

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

C++: using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                double x, y;
                double[] h = new double[6];
                String str = Console.ReadLine();
                if (str == null) break;
                string[] s = str.Split();
                for (int i = 0; i < 6; i++)
                {
                    h[i] = double.Parse(s[i]);

                    x = ((h[2] * h[4]) - (h[1] * h[5])) / ((h[0] * h[4]) - (h[1] * h[3]));
                    y = ((h[2] * h[3]) - (h[0] * h[5])) / ((h[3] * h[1]) - (h[0] * h[4]));
                    x = Math.Floor(x * 1000) / 1000;
                    y = Math.Floor(y * 1000) / 1000;
                    Console.WriteLine("{0:0.000} {1:0.000}", x, y);

                }
            }
        }
    }
}

C++: #include<cstdio>
#include<cmath>
int main(){
    double a[6];
    double x,y;
    while(~scanf("%lf",&a[0])){
        for(int i=1;i<6;i++){
            scanf("%lf",&a[i]);
        }
        y=(a[2]-(a[5]*(a[0]/a[3])))/(a[1]-(a[4]*(a[0]/a[3])));
        x=(a[2]-a[1]*y)/a[0];
        printf("%.3lf %.3lf\n",rint(x*1000)/1000.0,rint(y*1000)/1000.0);
    }
}

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

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

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

}

C++: #include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>

using namespace std;
int main() {
    float a,b,c,d,e,f,x,y;
    while(cin >> a){
        cin >> b;
        cin >> c;
        cin >> d;
        cin >> e;
        cin >> f;

        x = (-f+e*c/b)/(-d+a*e/b);
        y = (c-a*x)/b;
        x *= 1000;
        y *= 1000;
        x += 0.5f;
        y += 0.5f;
        x = (int)x;
        y = (int)y;
        x /= 1000.0f;
        y /= 1000.0f;
        printf("%.3f %.3f\n",x,y);

    }
    return 0;

}

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

#define N 1024

int main()
{
	char buff[N];
	
	while (NULL != fgets(buff, N, stdin))
	{
		double a, b, c, d, e, f;
		sscanf(buff, "%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f);
		
		double dd = a * e - b * d;
		double x = ( e * c - b * f ) / dd + 0.0;
		double y = ( - d * c + a * f ) / dd + 0.0;
		
		printf("%.3f %.3f\n", x, y);
	}
	return 0;
}

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

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

using namespace std;

int w[2][2];
int w0[2];

void solve(){
    float a0 = w[0][0] * w[1][1] - w[0][1] * w[1][0];
    int a1 = w0[0] * w[1][1] - w[0][1] * w0[1];
    int a2 = w[0][0] * w0[1] - w0[0] *w[1][0];
    float x = a1 / a0, y = a2 / a0;
    printf("%.3f, %.3f", x, y);
}

int main(){
    while(cin >> w[0][0] >> w[0][1] >> w0[0] >> w[1][0] >> w[1][1] >> w0[1]){
        solve();
    }
    return 0;
}