Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextFloat64() (float64, error) {
	return strconv.ParseFloat(nextString(), 64)
}

func mathRound(f float64) float64 {
	return math.Floor(f + .5)
}

func round(x float64) float64 {
	if math.Abs(x) < 0.001 {
		return 0
	}
	return mathRound(x*1000) / 1000
}

func main() {
	scanner.Split(bufio.ScanWords)
	for {
		a, err := nextFloat64()
		if err != nil {
			break
		}
		b, _ := nextFloat64()
		c, _ := nextFloat64()
		d, _ := nextFloat64()
		e, _ := nextFloat64()
		f, _ := nextFloat64()

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

		fmt.Printf("%.3f %.3f\n", round(x), round(y))
	}
}

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

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

}

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

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

	return (0);
}

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

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

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

int main(){
	double a, b, c, d, e, f;
	double x, y;
	double A, B, C;
	const double p = 0.00000001;

	while (cin >> a >> b >> c >> d >> e >> f){
		A = (a*e) - (b*d);
		B = (c*e) - (b*f);
		C = (a*f) - (c*d);

		x = B / A;
		y = C / A;
		
		if (abs(x) < p) x = 0;
		if (abs(y) < p) y = 0;

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

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

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

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

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

int main()
{
	solve();
	return(0);
}

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

using namespace std;

int main() {
	int i=0;
	int a[10000], b[10000], c[10000], d[10000], e[10000], f[10000];
	while (1) {
		cin >> a[i] >> b[i] >> c[i] >> d[i] >> e[i] >> f[i];
		if (a[i] == 0 && b[i] == 0 && c[i] == 0 && d[i] == 0 && e[i] == 0 && f[i] == 0)break;
		i++;
	}
	double x[10000], y[10000];
	for (int j = 0; j < i; j++) {
		y[j] = (double)(c[j] * d[j] - a[j] * f[j]) / (double)(b[j] * d[j] - a[j] * e[j]);
		x[j] = (double)(c[j] * e[j] - b[j] * f[j]) / (double)(a[j] * e[j] - b[j] * d[j]);
		printf("%.3lf %.3lf \n", x[j], y[j]);
	}
	return 0;
}

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

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

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

int main() {
  double a, b, c, d, e, f, x, y;
  while (cin >> a >> b >> c >> d >> e >> f) {
    x = (c * e - b * f) / (a * e - b * d);
    y = (c - a * x) / b;
    cout << fixed << setprecision(3) << x + 0 << " " << y + 0 << endl;
  }
  return 0;
}

C++: #include<stdio.h>
int main(void)
{
    int a,b,c,d,e,f;
    while(~scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f))
    {
        
        float x=(c*e-b*f)/(a*e-b*f);
        float y=(c*d-a*f)/(b*d-a*e);
        printf("%.3f %.3f\n",x,y);
        
    }
    return 0;
}

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

using namespace std;

int main() {

int a, b, c, d, e, f;

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

	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;
	cout << setprecision(3);
	cout << fixed;
	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 (x < 0.0005 && x > -0.0005)
			x = 0;
		if (y < 0.0005 && y > -0.0005)
			y = 0;
		cout << x << " " << y << endl;
	}
	return 0;
}

C++: #include <stdio.h>
#include<string>
#include<string.h>
#include <math.h>
#include<iostream>
#include <algorithm>
#include <map>
#include <vector>
#include <queue>
using namespace  std;


/*
//my header
#include "define.h"
#include "geometry.h"*/

#define MyAbs(a) ((a)>0?(a):-(a))
#define MyEqualDoule(a,b) (MyAbs(a-b)<1e-6)

void init()
{
#ifdef _WIN32
	freopen("1.txt", "r", stdin);
#endif
}

void func();

int main()
{
	init();
	func();

	return 0;
}


void func()
{
	int a,b,c,d,e,f;
	float x, y;
	while(~scanf("%d%d%d%d%d%d", &a, &b, &c, &d, &e, &f))
	{
			x = (c*e-f*b)*1.0/(a*e - b*d);
			y = (c*d-a*f)*1.0/(b*d - a*e);
			float x2 = (c-b*y)*1.0/a;
			if(x-x2 == 0)
				while(1);
		printf("%.3f %.3f\n", x2, y);
	}
}

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


double a,b,c,d,e,f;
double A,B;//x,y座標
int main(){
  while(scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f) !=EOF){
    
    if(a*e-b*d != 0){
    B =(c*e-f*b)/(a*e-b*d);
    A =(c -a*B)/b;
    }
    
    if(A > 0){
    A =round((A+0.0005)*1000)/1000;
    }else if(A < 0){
    A =round((A-0.0005)*1000)/1000;
    }
    if(B > 0){//小数第4位を四捨五入
    B =round((B+0.0005)*1000)/1000;
    }else if(B <0){
    B =round((B-0.0005)*1000)/1000;
    }
    printf("%.3f %.3f\n",B,A);
  }
  return 0;
}

C++: #include <stdio.h>

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

C++: #include <iostream>
#include <iomanip>
#include <cstdio>
using namespace std;
 
int main()
{
    int a, b, c, d, e, f;
    cout << showpoint << setprecision(3);
    while (cin >> a >> b >> c >> d >> e >> f){
        double x = ((double)(b*f - c*e)) / (double)(b*d - a*e);
        double y = ((double)(c*d - a*f)) / (double)(b*d - a*e);
        printf(".3f .3f", &x, &y)
    }
    cout.flush();
}

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

int main(){

	int a,b,c,d,e,f;

	double x,y;

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

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

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

	}

	return 0;
}

C++: #include <stdio.h>

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

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