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<iostream>
#include<algorithm>

using namespace std;

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

int main(){
	while (1){
		cin >> a >> b >> c >> d >> e >> f;
		y = (c - f*a / d) / (b - e*a / d);
		x = -b / a*y + c / a;
		cout << x << " " << y << endl;
	}
}

C++: #include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
using namespace std;
const double eps = 1e-5;

bool equals(double a, double b) {
  return abs(a-b) < eps;
}

int main() {
  int a, b, c, d, e, f;
  while(cin >> a >> b >> c >> d >> e >> f) {
    double y = (d*c-a*f)/(double)(d*b-a*e);
    double x = (f-e*y)/(double)d;
    if(equals(x,0.0)) x = 0;
    if(equals(y,0.0)) y = 0;
    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,((-g)*c+a*f)/g);
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
long long gcd(long long a,long long b)
{
    while(b!=0)
    {
        a=a%b;
        swap(a,b);
    }
    return a;
}
int main()
{
    int a,b,c,d,e,f;
    while(cin>>a>>b>>c>>d>>e>>f)
    {
        double x,y;
        x=((c*d)-(f*a))/((b*d)-(e*a));
        y=((c*e)-(f*b))/((a*e)-(d*b));
        printf("%.3lf %.3lf\n",y,x);
    }
}

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

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

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

		y=(a*f-c*d)/(a*e-b*d);
		x=(c*e-b*f)/(a*e-b*d);
		cout<<fixed<<setprecision(3)<<x<<" "<<y<<endl;
	}
	return 0;
}

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

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

double round( double val, int precision )
{
    double    ret;
    char    buf[256] = {'\0'};
    char    *p;

    sprintf( buf, "%.*f", precision, val );
    ret = strtod( buf, &p );

    return ret;
}

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

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

using namespace std;

// 書き方程式を解く
// ax + by = c
// dx + ey = f
int main() {

    double a, b, c, d, e, f;
    vector<double> ansX;
    vector<double> ansY;
    
    double k1, k2, x, y;
    while (cin >> a >> b >> c >> d >> e >> f) {
        // (a * e)x + (e * b)y = (e * c)
        // (b * d)x + (b * e)y = (f * b)
        k1 = (e * c - f * b);
        k2 = (a * e - b * d);
        if (k1 == 0 && k2 < 0) k2 *= -1;
        x = k1 / k2;
        //(d * a)x + (d * b)y = (d * c)
        //(a * d)x + (a * e)y = (a * f)
        k1 = (d * c - a * f);
        k2 = (d * b - a * e);
        if (k1 == 0 && k2 < 0) k2 *= -1;
        y = k1 / k2;
        ansX.push_back(x);
        ansY.push_back(y);
    }
    
    for (int i = 0; i < ansX.size(); i++) {
        printf("%.3f %.3f\n", ansX[i], ansY[i]);
    }
    
    return 0;
}

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

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

    while(cin >> a >> b >> c >> d >> e >> f)
    {
        det = (double) (a*e-b*d);
        det = 1.0 /det;
        x = ((double)(c * e - b * f))  * det;
        x = ceil(1000.0*x-0.5) /1000.0;
        y = ((double)(a * f - c * d)) * det;
        y = ceil(1000.0*y-0.5) /1000.0;
        if(abs(x) < 0.0001) x =0.0;
        if(abs(y) < 0.0001) y =0.0;
        printf("%.3lf %.3lf\n", x, y);
    }
    return 0;
}

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


int main() {
	float a,b,c,d,e,f;
	while(cin >> a >> b >> c >> d >> e >> f){
		float e2 =e*(a/d);
		float f2 =f*(a/d);
		d=a;
		float y=(c-f2)/(b-e2);
		float x=(c-b*y)/a;
		x*=1000;
		y*=1000;
		x=int(x+.5-(x<0));
		y=int(y+.5-(y<0));
		x*=(1/1000);y*=(1/1000);
		cout <<fixed;
		cout << setprecision(3) << x << " " << y << endl;

	}
	return 0;
}

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

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

C++: #include <stdio.h>


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

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

using namespace std;

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

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

	return 0;
}

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

void OutputSolution(int a, int b, int c, int d, int e, int f)
{
    long double x, y;
	if(b == 0){
		x = c / a;
		y = (f-d*x) / e;
	}else{
		int B = b;
		a *= e;
		b *= e;
		c *= e;
		d *= B;
		e *= B;
		f *= B;
		x = (c-f) / (a-d);
		y = (c-a*x) / b;
	}
	cout << fixed << setprecision(3) << x << ' ' << y << endl;
}

int main()
{
	while(true){
		int a, b, c, d, e, f;
		cin >> a >> b >> c >> d >> e >> f;
		if(cin.eof()) break;
		OutputSolution(a, b, c, d, e, f);
	}
	return 0;
}

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;
    x = double(round(x * 1000)) / 1000;
    y = double(round(y * 1000)) / 1000;
    if (abs(x) < 0.0001) x = 0;
    if (abs(y) < 0.0001) 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;
  cin >> a >> b >> c >> d >> e >> f;   
  y = (f-(d*c)/a)/(e-(d*b)/a);
  x = (c-b*y)/a;
  cout << fixed << setprecision(3) << x << " " << y << endl;
  cin >> a >> b >> c >> d >> e >> f;   
  y = (f-(d*c)/a)/(e-(d*b)/a);
  x = (c-b*y)/a;

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

}