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.Println(".000")
		fmt.Print(y)
		fmt.Println(".000")
	}
}

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

double* solve_equations(double *a)
{
	// クラメルの公式を用いる
	int data_size=sizeof(a[0]);
	/*cout << "data_size=" << data_size << endl;
	cout << "a=" << a << endl;
	cout << "*(a + data_size*1)=" << *(a + 1) << endl;
	cout << "*(a + data_size*0) * *(a + data_size*4)" << *(a + data_size*0) * *(a + data_size*4) << endl; */
	double z = *(a + 0) * *(a + 4) 
		   - *(a + 1) * *(a + 3);
	double x = *(a + 2) * *(a + 4)
		   -	*(a + 1) * *(a + 5);
	double y = *(a + 0) * *(a + 5)
		   - *(a + 2) * *(a + 3); 
	double ax,ay;
	/*cout << "x=" << x << endl;
	cout << "y=" << y << endl;*/
	ax = pow(z,-1)*x;
	ay = pow(z,-1)*y;
	
	/* cout << ax << endl;
	cout << ay << endl; */
	double ans[2] = {ax,ay};
	return ans;
}

int main()
{
	int s1,s2,s3,s4,s5,s6;
	int i=0;
	 while (cin >> s1 && cin >> s2 && cin >> s3 && cin >> s4 && cin >> s5 && cin >> s6){
		 double n[]={s1,s2,s3,s4,s5,s6};
		// if (i == 5){
		//	n[i]=s;
			/* for (int j=0;j<=5;j++)
			{
				cout << "n[" << j << "]=" << n[j] << endl;
			}*/
			double* an;
			an = solve_equations(n);
			/* printf("%.3lf",*(an+0));
			cout << " " << endl;
			printf("%.3lf",*(an+1)); */
			if (an[1] == 0)
				cout << fixed << setprecision(3) << an[0] << " " << 0.000 << endl;
			else if(an[0] == 0)
				cout << fixed << setprecision(3) << 0.000 << " " << an[1] << endl;
			else
				cout << fixed << setprecision(3) << an[0] << " " << an[1] << endl;

			i = 0;}
		//else{
		//	n[i]=s;
		//	i++;
		//}

	return 0;
			// cout << l[0]  endl;
}

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

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

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

C++: #define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <iostream>
#include <vector>
#include <list>
#include <map>
#include<string>
#include <algorithm>
#include <functional>
#include <cmath>
using namespace std;
typedef vector <int> ivector;


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


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

C++: #include <stdio.h>
#include <algorithm>
#include <cstdio>
using namespace std;
static const double EPS = 1e-9;
int main(){
	double a,b,c,d,e,f;
	while(~scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f)){
		double x = (b*f-e*c)/(b*d-e*a);
		double y = (c-a*x)/b;
		printf("%.3lf %.3lf\n",x+EPS,y+EPS);
	}
}

C++: #include <iostream>
#include <iomanip>
using namespace std;
int main(){
double a,b,c,d,e,f;
while(cin >> a >> b >> c >> d >> e >> f,!cin.eof()){
b/=a,c/=a,a=1;
e-=d*b,f-=d*c,d=0;
f/=e,e=1;
c-=b*f,b=0;
c+=0.0004,f+=0.0004;
cout << setprecision(3) << fixed << c << " " << f << endl;
}
}

C++: #include <stdio.h>
int main(){
	float a = 0,b = 0,c = 0,d = 0,e = 0,f = 0;
	float x = 0,y = 0;

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

			if((c - f) == 0 || (a - d) == 0){
				y = 0;
			}
			else{
				y = (c - f) / (a - d);
			}
			
		}
		else{
			b *= d / a;
			c *= d / a;
			a *= d / a;

			if((c - f) == 0 || (b - e) == 0){
				y = 0;
			}
			else{
				y = (c - f) / (b - e);
			}
		}

		if((c - b * y) == 0 || a == 0){
				x = 0;
		}
		else{
			x = (c - b * y) / a;
		}
	
		printf("%0.3f %0.3f\n",x,y);

	}

	return 0;
}

C++: *
 * http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0004
 */
#include <iomanip>
#include <iostream>
#include <sstream>
#include <vector>

#define N 2
#define L N*(N+1)

using namespace	std;

int
main()
{
	string line;
	while (getline(cin, line)) {
		istringstream iss(line);
		vector <float> coef(L);
		for (int i = 0; i < L; i++)
			iss >> coef[i];
		float pivot, mul;
		for (int i = 0; i < N; i++) {
			pivot = coef[i * (N + 1) + i];
			for (int j = 0; j < N + 1; j++) {
				coef[i * (N + 1) + j] = (1 / pivot) * coef[i * (N + 1) + j];
			}
			for (int k = i + 1; k < N; k++) {
				mul = coef[k * (N + 1) + i];
				for (int l = i; l < N + 1; l++) {
					coef[k * (N + 1) + l] = coef[k * (N + 1) + l] - mul * coef[i * (N + 1) + l];
				}
			}
		}
		for (int i = N - 1; i > 0; i--) {
			for (int k = i - 1; k >= 0; k--) {
				mul = coef[k * (N + 1) + i];
				for (int l = i; l < N + 1; l++) {
					coef[k * (N + 1) + l] = coef[k * (N + 1) + l] - mul * coef[i * (N + 1) + l];
				}
			}
		}
		for (int i = 0; i < N; i++) {
			if (i > 0) cout << ' ';
			cout << fixed << setprecision(3) << coef[i * (N + 1) + N];
		}
		cout << endl;
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	double a,b,c,d,e,f,x,y;
	while(cin>>a>>b>>c>>d>>e>>f){
		y=(d*c-f*a)/(b*d-e*a);
		x=(c-b*y)/a;
		cout<<x<<" "<<y<<endl;
	}
}

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){
    if(b*f-c*e!=0&&a*e-d*b!=0)printf("%.3f %.3f\n",(d*b-e*a)/(b*f-c*e),(a*f-d*c)/(a*e-d*b));
    if(b*f-c*e==0&&a*e-d*b==0)printf("0.000 0.000");
    if(b*f-c*e==0)printf("0.000 %.3f\n",(a*f-d*c)/(a*e-d*b));
    if(a*e-d*b==0)printf("%.3f 0.000\n",(d*b-e*a)/(b*f-c*e));
  }
  return 0;
}

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

#define EPS 1e-9

int main(){
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);

    double a, b, c, d, e, f;
    while(std::cin >> a >> b >> c >> d >> e >> f){
        double x = std::round(1000*(c*e-b*f)/(a*e-b*d))/1000;
        double y = std::round(1000*(a*f-c*d)/(a*e-b*d))/1000;
        std::cout << std::fixed << std::setprecision(3) << ((std::fabs(x)<EPS)?0:x) << " " << ((std::fabs(y)<EPS)?0:y) << "\n";
    }
    
    return 0;
}