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 := cF / bE
		x := (c - (y * b)) / a

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

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

int main(void) {
    float a,b,c,d,e,f;
    float x,y;
    while (1){
        cin >> a;
        if (cin.eof())
            break;
        cin >> b >> c >> d >> e >> f;
        x=(e*c-b*f)/(a*e-b*d);
        y=(-d*c+a*f)/(a*e-b*d);
        printf("%.3f %.3f\n",x,y);
    }
    return 0;
}

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

void Simaltaneous(double a,double b,double c,double d,double e,double f){
    double x,y;
    y=(a*f-d*c)/(a*e-d*b);
    x=(c-b*y)/a;
    printf("%4.3f %4.3f\n",x,y);
    return ;
}

int main(){
    double a,b,c,d,e,f;
    while(cin >>a>>b>>c>>d>>e>>f){
        Simaltaneous(a,b,c,d,e,f);
    }
    return 0;
}

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

#include <math.h>
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(X==0){X=0};
		if(Y==0){Y=0};

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

	return 0;
}

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

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

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

// 一行取って、一番初めのTを習得
template <class T> int streamvar(std::istream& in, T& var)
{
    string s;
    if (!in) {
        return 1;
    }
    getline(in, s);
    istringstream is(s);
    is >> var;
    if (is.fail()) 
        return 1;
    return 0;
}
// 一行取って、T vectorに格納する
template <class T> int streamvec(std::istream& in, std::vector<T> &v)
{
    v.clear();
    string s;

    if (!in) 
        return 1;
    getline(in, s);
    if (in.fail()) 
        return 1;
    istringstream is(s);
    while (1) {
        T tmp;
        is >> tmp;
        if (is.fail())
            break;
        v.push_back(tmp);
    }
    return 0;
}

int main(void)
{
    vector<int> v;
    while (!streamvec(cin, v)) {
        double det = v[0] * v[4] - v[3] * v[1];
        double x = v[4] * v[2] - v[1] * v[5];
        double y = -v[3] * v[2] + v[0] * v[5];
        printf("%.3f %.3f\n", round(x/det*1000)/1000, round(y/det*1000)/1000);
    }
    return 0;
}

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

/*
ax + by = c
dx + ey = f

x = (c-by)/a
d(c-by)/a + ey = f
dc/a - dby/a + ey = f
ey - dby/a = f - dc/a
y(e-db/a) = f - dc/a
y = (f-dc/a)/(e-db/a)

aex + bey = ce
bdx + bey = bf
aex - bdx = ce - bf
x(ae - bd) = ce - bf
x = (ce - bf)/(ae - bd)
by = c - ax
y = (c - ax)/b
*/
int main()
{
    while(true){
        double a, b, c, d, e, f;
        std::cin >> a >> b >> c >> d >> e >> f;
        if(std::cin.eof()) break;
        double x, y;
        if(b == 0) return 0;
        // if(b){
            // x = (c*e - b*f) / (a*e - b*d);
            // y = (c - a*x) / b;
        // }else{
            y = (f-d*c/a)/(e-d*b/a);
            x = (c-b*y)/a;
        // }
        if(x == -0) x = 0;
        if(y == -0) y = 0;
        std::cout << std::fixed << std::setprecision(3);
        std::cout << x << " " << y << std::endl;
    }
    return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <string>
#include <map>
#include <vector>
#include <set>
#include <iomanip>
#include <fstream>
#include <stdint.h>
#include <cmath>
#include <algorithm>
#include <utility>
#include <numeric>
using namespace std;

constexpr int INF       = 1000000000;/* 1e+9a */
constexpr int MODULO    = 1000000007;

#define REP(i,f,n) for(int i=(f); i < (n); ++i)
#define PER(i,f,n) for(int i=(n-1); i >= f; --i)

signed main()
{
    ios::sync_with_stdio(false);
	int a, b, c, d, e, f;
	while(cin >> a)
	{
		cin >> b >> c >> d >> e >> f;
		double m = a * e - b * d;
		double x = (c * e - b * f)/m;
		double y = (a * f - c * d)/m;
		int64_t ix = x * 1000 + 0.5;
		int64_t iy = y * 1000 + 0.5;
		/* printf("%.3lf %.3lf\n", ix / 1000., iy / 1000.); */
		printf("%.3lf %.3lf\n", x , y);
	}
}

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

int main()
{
	int 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);
		cout<<setprecision(3)<<fixed;
		cout<<x<<" "<<y<<endl;
	}
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<cmath>
#include<cstdio>
using namespace std;
int main(){
	double a,b,c,d,e,f,n[20];
	while(cin>>a>>b>>c>>d>>e>>f){
	double x,y;
	int w;
	if(a == 0){
		n[0] = 0;
		n[1] = 0;
	}else{
		n[0] = c / a;
		n[1] = b / a;
	}
	if(d == 0){
		n[2] = 0;
		n[3] = 0;
	}else{
		n[2] = f / d;
		n[3] = e / d;
	}
	if(b == 0){
		n[4] = 0;
		n[5] = 0;
	}else{
		n[4] = c / b;
		n[5] = a / b;
	}
	if(e == 0){
		n[6] = 0;
		n[7] = 0;
	}else{
		n[6] = f / e;
		n[7] = d / e;
	}
	if(n[1] - n[3] == 0){
		y = 0;
	}else{
		y = (n[0] - n[2]) / (n[1] - n[3]);
	}
	if(n[5] - n[7] == 0){
		x = 0;
	}else{
		x = (n[4] - n[6]) / (n[5] - n[7]);
	}
	x = x * pow(10, - 5);
	double xx = x + 0.5;
	xx = xx * pow(10,5);
	y = y * pow(10, - 5);
	double yy = y + 0.5;
	yy = yy * pow(10,5);

	printf("%0.3f,%0.3f\n",xx,yy);



}
return 0;
}

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

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

C++: #include <stdio.h>

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