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 <iomanip>
#include <iostream>
#include <vector>
#define N 2
 
using namespace std;
typedef vector< vector<double> > Equation;
 
bool input(Equation& c)
{
	if (!cin) return false;

    for (int i = 0; i < N; ++i)
        for (int j = 0; j < N + 1; ++j)
            cin >> c[i][j];
 
    return true;
}
 
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
 
    Equation c(N, vector<double>(N + 1));
	while (input(c))
	{
		// Gaussian elimination
		// 1. Forward elimination
        for (int i = 0; i < N - 1; ++i)
            for (int j = i + 1; j < N; ++j)
            {
                double d = c[j][i] / c[i][i];
                for (int k = i + 1; k <= N; ++k)
                    c[j][k] -= c[i][k] * d;
            }
 
		// 2. Back substitution
        for (int i = N - 1; i >= 0; --i)
        {
            double d = c[i][N];
            for (int j = i + 1; j < N; ++j)
                d -= c[i][j] * c[j][N];
            c[i][N] = d / c[i][i];
        }
 
        cout << setprecision(4) << fixed << c[0][N];
        for (int i = 1; i < N; ++i)
            cout << " " << c[i][N];
        cout << endl;
    }
 
    return 0;
}

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

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

		cout << fixed << setprecision(3) << x << " " << fixed << setprecision(3) << y << endl;
	}
	return 0;
}

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

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

C++: #include<iostream>
#include<iomanip>
using namespace std;
int main()
{
	float a,b,c,d,e,f;
	float x,y;
	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);
		cout<<setiosflags(ios::fixed);
		cout<<setprecision(3)<<x<<" "<<y<<endl;
	}
	return 0;
}

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

float check(float f) {
	return f == 0 ? 0 : f;
}

int main() {
	float a, b, c, d, e, f;
	while (std::cin >> a >> b >> c >> d >> e >> f) {
		float
			x = (c * e - b * f) / (a * e - b * d),
			y = (c * d - a * f) / (b * d - a * e);

		std::cout
			<< std::fixed << std::setprecision(3) << check(x)
			<< " "
			<< std::fixed << std::setprecision(3) << check(y)
			<< std::endl;

	}
}

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

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

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

int main() {
    string line;
    while (getline(cin, line)) {
        int a, b, c, d, e, f;
        stringstream ss(line);
        ss >> a >> b >> c >> d >> e >> f;

        double x, y;
        if (b*d != a*e) {
            y = static_cast<double>(c*d - a*f) / (b*d - a*e);
            x = static_cast<double>(c - b*y) / a;
        } else {
            x = static_cast<double>(c*e - b*f) / (a*e - b*d);
            y = static_cast<double>(c - a*x) / b;
        }
        cout.precision(4);
        cout << showpoint << x << " " << y << endl;
    }
}

C++: #include <iostream>
#include <string>
#include <cctype>
#include <cmath>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <map> // pair
#include <set>
#define MAXSIZE 200000
#define PI 3.141592653589
using namespace std;

template<typename T>
T add(T a,T b){
  return a+b;
}

namespace A
{
  int f(void){
    return 1;
  }
}

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

}

C++: #include <stdio.h>

int main(){
	int a,b,c,d,e,f,g,h,i,j,k,l;
	double x,y;
	while(scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f)!=EOF){
	g=b*d;
	h=e*a;
	i=c*d;
	j=f*a;
	k=g-h;
	l=i-j;
	y=(double)l/(double)k;
	x=((double)c-(double)b*(double)y)/(double)a;
	printf("%.3f %.3f",x,y);
	}
	return 0;
}

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

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

C++: #include <stdio.h>
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){
		if(a*e!=b*d){
			x = (e*c-b*f)/(a*e-b*d);
			y = (a*f-c*d)/(a*e-b*d);
			x*=1000;y*=1000;
			x+=0.5;y+=0.5;x=(int)x;y=(int)y;
			x/=1000;y/=1000;
			printf("%.3f %.3f\n",x,y);
		}
	}
	return 0;
}

C++: #include <cstdio>

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

	while(scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f)!=EOF){
		g=a*e-b*d;
		printf("%lf %lf\n",(e*c+(-b)*f)/g,((-d)*c+a*f)/g);
	}
	return 0;
}

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

int main(void){

	while (true){
		float a, b, c, d, e, f;
		cin>>a>>b>>c>>d>>e>>f;
		if (cin.eof()) break;

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

C++: #include <iostream>
#include <math.h>
#include <cstdio>

using namespace std;

int main() {
	char s[1000];
	while (1) {
		string str;
		if ( !getline(cin, str) ) break;

		for (int i = 0; i < str.size(); ++i)
			s[i] = str[i];
		s[str.size()] = '\0';

		double a, b, c, d, e, f;
		sscanf(s, "%lf%lf%lf%lf%lf%lf", &a, &b, &c, &d, &e, &f);

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

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

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

int main()
{
    // your code goes here
    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 - a * x) / b;
        if (x == -0.0)
        {
            x = 0.0;
        }
        if (y == 0.0)
        {
            y = 0.0;
        }
        printf("%.3lf %3lf\n", x, y);
    }
    return 0;
}