Go: package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Split(bufio.ScanWords)
	for {
		data := nextInts(6)
		fmt.Printf("%.3f\n", Round(GetX(data[0], data[1], data[2], data[3], data[4], data[5]), 3))
		fmt.Printf("%.3f\n", Round(GetY(data[0], data[1], data[2], data[3], data[4], data[5]), 3))
	}
}

func GetX(a, b, c, d, e, f float64) float64 {
	return ((c * e) - (b * f)) / ((a * e) - (b * d))
}

func GetY(a, b, c, d, e, f float64) float64 {
	return ((c * d) - (a * f)) / ((b * d) - (a * e))
}

func Round(f float64, places int) float64 {
	shift := math.Pow(10, float64(places))
	return math.Floor(f*shift+.5) / shift
}

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() float64 {
	a, _ := strconv.Atoi(next())
	return float64(a)
}

func nextInts(n int) []float64 {
	a := make([]float64, n)
	for i := 0; i < n; i++ {
		a[i] = nextInt()
	}
	return a
}

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

using namespace std;

int main(void) {
	double x, y;
	double a, b, c, d, e, f;
	
	while(1) {
		cin >> a >> b >> c >> d >> e >> f;
		if(cin.eof()) { break; }
		
		y = (f-d*(c/a))/(-d*(b/a)+e);
		x = (c-b*y)/a;
		cout << setiosflags(ios::fixed) << setprecision(4) << x << " " << y << endl;
	}
	
	return 0;
}

C++: #include<cstdio>
int main(void)
{
	int a,b,c,d,e,f;
	double x,y;
	while(scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f))!=EOF)
	{
		y=(a*f-d*c)/(-(d*b)+a*e);
		x=(c-b*y)/a;
		printf("%.3lf %.3lf\n",x,y);
	}
	return 0;
}
/*
ax=c-by
->x=(c-by)/a
d((c-by)/a)+ey=f
(dc-dby)/a+ey=f
(dc-dby)+aey=af
-dby+aey=af-dc
y(-db+ae)=af-dc
->y=(af-dc)/(-db+ae)
*/

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

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

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

C++: #include<stdio.h>

void printFunc(int a,int b,int c,int d,int e,int f);

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

  scanf ("%d %d %d %d %d %d\n",&a,&b,&c,&d,&e,&f);
  printFunc(a,b,c,d,e,f);
  scanf ("%d %d %d %d %d %d\n",&a,&b,&c,&d,&e,&f);
  printFunc(a,b,c,d,e,f);

  return 0;
}

void printFunc(int a,int b,int c,int d,int e,int f){
  float ansX,ansY;
  if(b == 0 || e == 0){
    ansY = 0;
  }
  else{
    ansY = (float)(b*f - e*c)/(float)(b*d - e*a);
  }

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

  printf("%.3f %.3f\n",ansX,ansY);
}

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

int main() {
	// your code goes here

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

  while(cin >> a >> 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);

    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;
    while(cin>>a>>b>>c>>d>>e>>f){
        y=(c*d-f*a)/(b*d-e*a);
        x=(c*e-f*b)/(a*e-d*b);
        cout<<fixed<<setprecision(3)<<x+0.00005<<" "<<y+0.00005<<endl;
    }
}

C++: #include<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<vector>
#include<functional>
#include<algorithm>
#include<cstdio>
using namespace std;
int main() {
	int a, b, c, d, e, f;
	while (cin >> a >> b >> c >> d >> e >> f) {
		int a2 = a, b2 = b, c2 = c;
		int g = a, h = d;
		if (g > h) swap(g, h);
		while (g != 0) {
			int k = g;
			g = h%g;
			h = k;
		}
		h = (h*(a / h)*(d / h));
		if (a2 != 0){
			b = b*(h / a2); 
			c = c*(h / a2);
		}
		else {
			b = 0;
			c = 0;
		}
		if (d != 0) {
			e = e*(h / d);
			f = f*(h / d);
		}
		else {
			e = 0;
			f = 0;
		}
		long double ansx,ansy;
		if (e - b != 0)ansx = ((long double)(f - c) / (e - b));
		else ansx = 0;
		ansy = (c2 - ansx*b2) / a2;
		ansx = ansx * 1000;
		ansx = round(ansx);
		ansx /= 1000;
		ansy = ansy * 1000;
		ansy = round(ansy);
		ansy /= 1000;
		printf("%.3LF %.3LF\n", ansy, ansx);
	}
}

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

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

C++: #include<stdio.h>
int main(){
	int a,b,c,d,e,f;
	double x,y;
	scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f);
	x=(double)(c*e-b*f)/(a*e-b*d);
	y=(double)(c*d-a*f)/(b*d-a*e);
	if(x>0){
		x=x+0.0005;
	}
	else{
		x=x-0.0005;
	}
	if(y>0){
		y=y+0.0005;
	}
	else{
		y=y-0.0005;
	}
	printf("%.3lf %.3lf\n",x,y);
}

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

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

	}
	getchar();
	getchar();
	return 0;
}

C++: #include<iostream>

using namespace std;
   
void Simultaneous()
{
    double a, b, c, d, e, f;
    double 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.setf(ios::fixed); //"setf" is used for “half-adjusting”
        cout.precision(3); //precision is used for rould off three places of decimals
        
        //-0主要用来表&#36798;浮点数
        //-0有可能被用来表示一个可以四舍五入&#20026;零的&#36127;数，或者是一个从&#36127;方向上&#36235;近于零的数。
        // 下面的式子可&#35753;&#36127;0&#21464;成无符号的0
        if(x == 0)
        {
            x = 0;
        }
        
        if(y == 0)
        {
            y = 0;
        }
        
        cout<<x<<" "<<y<<endl;
    }
            
    return;
}
     
int main()
{     
    Simultaneous();
    return 0;
}

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

using namespace std;
int main(void){
	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/a-b/a*y;
	printf("%.4f",x);
	printf(" ");
	printf("%.4f\n",y);	
}

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()
{
	float a,b,c,d,e,f, x, y;
	while(~scanf("%f%f%f%f%f%f", &a, &b, &c, &d, &e, &f))
	{
		if(MyEqualDoule(a*e-b*d,0))
			x = 0;
		else
			x = (c*e-f*b)/(a*e - b*d);

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