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<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);
	}
}

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

int main(){
	double aa, bb, cc, a, b, c, d, e, f, x, y;				//®1:ax + by = c, ®2:dx + ey = f
	
	while(cin >>a >>b >>c >>d >>e >>f){						//EOFªüÍ³êéÜÅ[v
		aa = a; bb = b; cc = c;								//üÍ³ê½a, b, cÌlðÛ
		
		b /= a; c /= a; a /= a;								//®1F¼ÓðaÅé
		e /= d; f /= d; d /= d;								//®2F¼ÓðdÅé
		
		b -= e; c -= f;										//®1©ç®2ðø­, ÊÍ®1ÌÏÖ
		
		y = c / b;											//15sÚÌÊ©çyðvZ
		x = (cc - (bb * y)) / aa;							//®1ÉyðãüµxðvZ
		
		if(x < 0) x = ceil(x * 1000 - 0.5) / 1000;			//xð¬_ælÊÅlÌÜü(ÌÌê)(1000{¨0.5ðø­¨¬_Øã°¨1/1000{)
		else x = floor(x * 1000 + 0.5) / 1000;				//xð¬_ælÊÅlÌÜü(³ÌÌê)(1000{¨0.5ð«·¨¬_ØÌÄ¨1/1000{)
		if(y < 0) y = ceil(y * 1000 - 0.5) / 1000;			//xð¬_ælÊÅlÌÜü(ÌÌê)
		else y = floor(y * 1000 + 0.5) / 1000;				//xð¬_ælÊÅlÌÜü(³ÌÌê)
		
		printf("%.3f %.3f\n", x, y);						//x, yðoÍ
	}
	
	return 0;
}

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

using namespace std;

int main(){
  double a,b,c,d,e,f;
  vector<double> out;
  while (scanf("%f %f %f %f %f %f",&a,&b,&c,&d,&e,&f)!=EOF){
    out.push_back((c*e-b*f)/(a*e-b*d));
    out.push_back((c*d-a*f)/(b*d-a*e));
  }
  for (int i=0;i<out.size();i+=2){
    printf("%f %f\n",round(out[i]*1000)/1000.0,round(out[i+1]*1000)/1000.0);
  }
  return 0;
}