Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

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]
		var mulA, mulD int
		if a < 0 {
			mulA = a * -1
		} else {
			mulA = a
		}
		if d < 0 {
			mulD = d * -1
		} else {
			mulD = d
		}
		a *= mulD
		b *= mulD
		c *= mulD
		d *= mulA
		e *= mulA
		f *= mulA

		if d < 0 {
			d *= -1
			e *= -1
			f *= -1
		}

		bE := b - e
		cF := c - f
		if bE == 0 {
			bE = 1
		}
		y := cF / bE
		x := (c - (y * b)) / a

		fmt.Print(x)
		fmt.Print(".000 ")
		fmt.Print(y)
		fmt.Println(".000")
	}
}

C++: #include<stdio.h>

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

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

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

int main(){
	double a11=0,a12=0,c=0,a21=0,a22=0,f=0;
	while(cin>>a11){
		cin>>a12>>c>>a21>>a22>>f;
		double x,y,delta=((double)a11*a22-(double)a12*a21);
		x=((double)a22*c-(double)a12*f)/delta;
		y=((double)a11*f-(double)c*a21)/delta;
		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("%.4lf %.4lf\n",x,y);
	}
	return 0;
}

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

using namespace std;
double a,b,c,d,e,f;
double x,y;



int main()
{
    while(cin >> a >> b >> c >> d >> e >> f)
    {
        x = ((c*e)-(b*f))/((a*e)-(b*d));
        y = ((a*f)-(c*d))/((a*e)-(b*d));
        if(x==-0)
        {
            x=0;
        }
        if(y==-0)
        {
            y=0;
        }

        cout << fixed << setprecision(3) << x << " " << y;

    }
}

C++: //Simultaneous Equation

#include <iostream>
#include <cstdio>
#include <cassert>
#include <cmath>
#include <cfloat>

namespace {

inline bool is_nearly_zero(double x)
{
  if (std::abs(x) < DBL_EPSILON)
    return true;
  else
    return false;
}

}

int main()
{
  while (1) {
    double x, y;
    double a, b, c, d, e, f;
    std::cin >> a >> b >> c >> d >> e >> f;
    if (std::cin.fail()) break;

    const double det = (a * e) - (b * d);
    assert(!is_nearly_zero(det));

    const double inv_mat[2][2] = {
    	{e, -b},
    	{-d, a}
    };

    x = ((inv_mat[0][0] * c) + (inv_mat[0][1] * f)) / det;
    y = ((inv_mat[1][0] * c) + (inv_mat[1][1] * f)) / det;

	if (is_nearly_zero(x)) x = 0.0;
	if (is_nearly_zero(y)) y = 0.0;
	
    printf("%.3f %.3f\n", x, y);
  }

  return 0;
}

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,!cin.eof())
	{
		y = b/e;
		x = (y*f-c)/(y*d-a);
		y = (c-a*x)/b;
		cout.setf(ios::fixed);
		cout.precision(3); ;
		cout<<x<<" "<<y<<endl;
	}
	return 0;
}

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){
    x = (c - f*b / e) / (a - d*b/e);
    y = (c - f*a / d) / (b - e*a/d);

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

  return 0;
}

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

int main(){
	double a, b, c, d, e, f;
	cout << setprecision(3) << setiosflags(ios::fixed);

	while(cin >> a >> b >> c >> d >> e >> f){
		cout << (c*e-b*f)/(a*e-b*d) << " " << (c*d-a*f)/(b*d-a*e) << endl;
	}

	return 0;

}

C++: #include<cstdio>
#include<iostream>
using namespace std;
int main(){
        double a1,a2,b1,b2,c1,c2,x,y;
        while(scanf("%lf%lf%lf%lf%lf%lf",&a1,&b1,&c1,&a2,&b2,&c2)!=EOF){
                x=(b2*c1-c2*b1)/(a1*b2-a2*b1);
                y=(a1*c2-a2*c1)/(a1*b2-a2*b1);
                if(x==-0)x=0;
                if(y==-0)y=0;
                printf("%.3lf %.3lf\n",x,y);
        }
        return 0;
}

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

using namespace std;

int main(){

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

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

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

cout << setprecision(4) << 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) / (a * e - b * d);
        y = (double)(a * f - d * c) / (a * e - b * d);

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

C++: #include <iostream>

using namespace std;

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

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

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	double a, b, c, d, e, f;
	while(cin >> a >> b >> c >> d >> e >> f){
		//double x = (c * e - f * b) / (a * e - d * b);
		double y = (c * d - f * a) / (b * d - a * e);
		double x = (- b * y + c) / a;
		
		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,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<cstdio>

int a,b,c,d,e,f;
double x,y;

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

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

using namespace std;

int main(void) {
	double x, y;
	double a, b, c, d, e, f;
	
	while(1) {
		cin >> a >> b >> c >> d >> e >> f;
		if(cin.eof()) { break; }
		
		y = (f-d*(c/a))/(-d*(b/a)+e);
		x = (c-b*y)/a;
		cout << setiosflags(ios::fixed) << setprecision(4) << x << " " << y << endl;
	}
	
	return 0;
}

C++: #include<cstdio>
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=(a*f-d*c)/(-(d*b)+a*e);
		x=(c-b*y)/a;
		printf("%.3lf %.3lf\n",x,y);
	}
	return 0;
}
/*
ax=c-by
->x=(c-by)/a
d((c-by)/a)+ey=f
(dc-dby)/a+ey=f
(dc-dby)+aey=af
-dby+aey=af-dc
y(-db+ae)=af-dc
->y=(af-dc)/(-db+ae)
*/

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

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