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.Printf("%d.000 ", x)
		fmt.Printf("%d.000\n", y)
	}
}

C++: #define _USE_MATH_DEFINES

#include <iostream>
#include <string>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <utility>
#include <vector>
#include <numeric>

using namespace std;

int main()
{
	double a, b, c, d, e, f;
	for (; cin >> a >> b >> c >> d >> e >> f;)
	{
		double x, y;
		if (a == 0 || b == 0 || d == 0 || e == 0)
		{
			if (a == 0)
			{
				y = c / b;
				x = (f - e * y) / d;
			}
			else if (b == 0)
			{
				x = c / a;
				y = (f - d * x) / e;
			}

			if (d == 0)
			{
				y = f / e;
				x = (c - b * y) / a;
			}
			else if (e == 0)
			{
				x = f / d;
				y = (c - a * x) / b;
			}
		}
		else
		{
			double a0 = a * e;
			double c0 = c * e;

			double d0 = d * b;
			double f0 = f * b;

			x = (f0 - c0) / (d0 - a0);

			y = (c - a * x) / b;
		}

		if (x == 0)
		{
			x = abs(x);
		}
		if (y == 0)
		{
			y = abs(y);
		}

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

	}
}

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

double get(double a){
    if(abs(a) < 1e-9)return 0;
    return a;
}

int main(){
    double a, b, c, d, e, f;
    while(cin >> a >> b >> c >> d >> e >> f){
        double y = get((c-(a/d)*f)/(b-(a/d)*e));
        double x = get((c - b*y) / a);
        printf("%.3f %.3f", x,y);
        puts("");
    }
    return 0;
}

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

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

	std::cout << std::fixed << std::setprecision(3);
	while (std::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);
		if (x == -0) x = 0;
		if (y == -0) y = 0;
		std::cout << x << " " << y << std::endl;
	}

	return 0;
}

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

C++: #include<stdio.h>

int main(){
	double a,b,c,d,e,f,x,y,x2,y2;
	int status;
	while(1){
		status=scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f);
		if (status==EOF){
			break;
		}
		x=(f/e-c/b)/(d/e-a/b);
		y=c/b-a*x/b;
		x2=(b*f-c*e)/(b*d-a*e);
		y2=(c-a*x2)/b;
		x=x2;
		y=y2;
		
		if (x<0.0005 && x>-0.0005){
			x=0;
		}
		if (y<0.0005 && y>-0.0005){
			y=0;
		}
		printf("%.3f %.3f\n",x,y);
		printf("%f %f\n",x,y);
		printf("%.3f %.3f\n",x2,y2);
		printf("%f %f\n\n\n",x2,y2);
	}
	
	return 0;
}

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

#define FOR(i,a,b) for(long long int i=(a);i<(b);i++)
#define REP(i,n) for(long long int i=0;i<(n);i++)
#define ALL(s) (s).begin(),(s).end()

#define PI 3.14159265358479

typedef long long int ll;
typedef vector<long long int> vi;

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

C++: import sys

x = 0
y = 0
while True:
    try:
	 a,b,c,d,e,f = map(float,raw_input().split())
	 if a == 0:
	     y = c / b
	     x = (f - e * c / b) / d
	 elif b == 0:
	     x = c / a
	     y = (f - d * c / a) / e
	 elif d == 0:
	     y = f / e
	     x = (c - a * f / e) / a
	 elif e == 0:
	     x = f / d
	     y = (c - a * f / d) / b
	 else:
	     x = (c*e - b*f) / (a*e - b*d)
	     y = (c*d - a*f) / (b*d - a*e)

         if x == 0:
	     x = 0.0
	 if y == 0:
	     y = 0.0
	 print "%f %f" % (x,y)

    except EOFError:
	break

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

int main(){
	double a[6];
	double x,y;
	while(true){
		cin >> a[0];
		cin >> a[1];
		cin >> a[2];
		cin >> a[3];
		cin >> a[4];
		cin >> a[5];
		if(cin.eof())
			break;
			
		x = (a[4]*a[2]-a[1]*a[5])/(a[0]*a[4]-a[1]*a[3]);
		y = (-a[3]*a[2]+a[0]*a[5])/(a[0]*a[4]-a[1]*a[3]);
		
		cout << x << ".000 " << y <<".000" << endl;
	}
	return 0;
}

C++: #include <cstdio>
int main() {
	int a,b,c,d,e,f;
	while(scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f)!=EOF) {
		double y=(double)(c*d-a*f)/(b*d-a*e);
		double x=(c-b*y)/a;
		printf("%.3lf %.3lf\n",x,y);
	}
}

C++: #include <iostream>
#include <cstdio>
using namespace std;
int main(void){
	
	double x, y;
	int a, b, p;
	int c, d, q;

	while (cin >> a >> b >> p >> c >> d >> q){

		x = (double)(p * d - b * q) / (a * d - b * c);
		y = (double)(a * q - p * c) / (a * d - b * c);
		printf("%.3f %.3f\n", x, y);
	}
}

C++: #include<stdio.h>
#include<math.h>
int main(void){
    double a,b,c,d,e,f,A,x,y,X,Y,Z;

    while(scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f)!=EOF){
    A=a;
    a=a*d,b=b*d,c=c*d;
    d=d*A,e=e*A,f=f*A;

    Y=b-e,Z=c-f;
    y=Z/Y;
    x=(c-b*y)/a;

    /*x=x+0.0005,y=y+0.0005;
    x=x*1000,y=y*1000;
    x=floor(x);
    y=floor(y);
    x=x/1000,y=y/1000;*/
    if(1e-10>fabs(x))x=0;
    if(1e-10>fabs(y))y=0;
   printf("%.3lf %.3lf\n",x,y);
    }
   //printf("\na%lf\nb%lf\nc%lf\nd%lf\ne%lf\nf%lf\n%lf\n%lf",a,b,c,d,e,f,Y,Z);

    return 0;
}

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

C++: #define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main(void) {
	char string[54];
	double a, b, c, d, e, f, x, y;
	scanf("%[^\r\n]",string);
	
	a = atof(strtok(string, " "));
	b = atof(strtok(NULL, " "));
	c = atof(strtok(NULL, " "));
	d = atof(strtok(NULL, " "));
	e = atof(strtok(NULL, " "));
	f = atof(strtok(NULL, " "));

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

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

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

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

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

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

		x *= 10000;
		x = x + 0.5 - (x < 0);
		x = (int)x;
		x /= 10000;

		y *= 10000;
		y = y + 0.5 - (y < 0);
		y = (int)y;
		y /= 10000;


		cout << setprecision(4) << showpoint << x << " " << y << endl;
	}

	return 0;
}