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>

using namespace std;

int main()
{
	int a,b,c,d,e,f;
	float x,y,dx,dy;
	while( cin >> a >> b >>c >>d >> e >> f ) {
		x = (c*e-b*f)/(float)(a*e-b*d);
		y = (c - a*x)/(float)b;
		
		dx =x -  (x / 0.001)*0.001;
		if( dx >= 0.0005)
			x = (x / 0.001)*0.001 + 0.001;
		else
			x = (x / 0.001)*0.001;

		dy =y -  (y / 0.001)*0.001;
		if( dy >= 0.0005)
			y = (y / 0.001)*0.001 + 0.001;
		else
			y = (y / 0.001)*0.001;
	
		printf("%.3f %.3f\n",x,y);
	}



	return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double ESP=1e-10;
using namespace std;
int main(){
  double a,b,c,d,e,f;
  while(cin>>a){
    cin>>b>>c>>d>>e>>f;
    double x=(c*e-b*f)/(a*e-b*d);
    double y=(a*f-c*d)/(a*e-b*d);
    if(x==0)x=0;
    if(y==0)y=0;
    printf("%.3f %.3f\n",x,y);
  }
}

    
    /*
      ey=f-dx
      y=(f-dx)/e
      ax+b(f-dx)/e=c
      aex+df-bdx=ce
      (ae-bd)x=ce-df
      x=(ce-df)/(ae-bd)

  y=(f-dx)/e
  y=(f



a b  x  c
d e  y  f

x  c  e -b
y  f  -d a  /(ae-bd)*/

C++: #include<iostream>
#include<cstdio>
#include<iomanip>
#include<vector>
using namespace std;
class SimultaneousEquation{ 
    public:
        void solve(int a,int b,int c,int d,int e,int f){ 
            double x,y;
            x=double(a*e-b*d)/(c*e-b*f);
            y=double(c*d-a*f)/(b*d-a*e);
            printf("%.3lf %.3lf\n",x,y);
            }
};
int main(){ 
    int a,b,c,d,e,f;
    SimultaneousEquation inst;
    while(cin>>a>>b>>c>>d>>e>>f){
        inst.solve(a,b,c,d,e,f);
    }
}

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

void OutputSolution(int a, int b, int c, int d, int e, int f)
{
    double x, y;
	if(a == 0){
		y = c / b;
		x = (f-e*y) / d;
	}else{
		int A = a;
		a *= d;
		b *= d;
		c *= d;
		d *= A;
		e *= A;
		f *= A;
		y = (c-f) / (b-e);
		x = (c-b*y) / a;
	}
	cout << fixed << setprecision(3) << x << ' ' << y << endl;
}

int main()
{
	while(true){
		int a, b, c, d, e, f;
		cin >> a >> b >> c >> d >> e >> f;
		if(cin.eof()) break;
		OutputSolution(a, b, c, d, e, f);
	}
	return 0;
}

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

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

#define REP(i, a) for(int i=0;i<(int)a;++i)
using namespace std;

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-a*x)/b;

        if(abs(x)<1e-10){
            x=0;
        }
        if(abs(y)<1e-10){
            y=0;
        }
        printf("%.3f %.3f\n",x,y);
    }
    return 0;
}

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

using namespace std;

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

C++: 
/* vo00_04.cpp */
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <cstdio>
using namespace std;

int is_double(double dl);
double m_round(double d);

int main()
{
	double x1, y1, a1;
	double x2, y2, a2;
	double x, y;
	bool f_x, f_y;

	while (true) {
		cin >> x1 >> y1 >> a1 >> x2 >> y2 >> a2;
		if (cin.eof()) break;
		


		f_x = false; f_y = false;

		int p = max({ is_double(x1), is_double(x2), is_double(y1), is_double(y2) });
		if (p) { p *= 10; x1 *= p; x2 *= p; y1 *= p; y2 *= p; }

		if (x1 && x2) {
			int temp = x1;
			x1 *= x2; y1 *= x2; a1 *= x2;
			x2 *= temp; y2 *= temp; a2 *= temp;

			double y3 = y2 - y1, a3 = a2 - a1;

			y = a3 / y3;
			f_y = true;
		}

		if (y1 && y2) {
			int temp = y1;
			x1 *= y2; y1 *= y2; a1 *= y2;
			x2 *= temp; y2 *= temp; a2 *= temp;

			double x3 = x2 - x1, a3 = a2 - a1;

			x = a3 / x3;

			f_x = true;
		}

		if (!f_x || !f_y) {
			// どちらかに0があれば
			if (!x1) { y = a1 / y1; f_y = true; }
			else if (!x2) { y = a2 / y2; f_y = true; }

			if (!y1) { x = a1 / x1; f_x = true; }
			else if (!y2) { x = a2 / x2; f_x = true; }

			if (f_x) {
				if (x1) { x1 *= x; a1 -= x1; y = a1 / y1; }
				else if (x2) { x2 *= x; a2 -= x2; y = a2 / y2; }

				f_y = true;
			}
			if (f_y) {
				if (y1) { y1 *= y; a1 -= y1; x = a1 / x1; }
				else if (y2) { y2 *= y; a2 -= y2; x = a2 / x2; }

				f_x = true;
			}
		}

		if (f_x && f_y) {
			x = m_round(x); y = m_round(y);
			printf("%.3lf %.3lf\n", x, y);
		}
	}

	return 0;
}

int is_double(double dl)
{
	dl = fabs(dl);
	int d = (int)dl;
	double temp = dl - (double)d;

	if (!temp) return 0;

	else {
		int i;
		for (i = 0; temp < 1; ++i) temp *= 10;

		return i;
	}
}

double m_round(double d)
{
	bool flag = false;
	if (d < 0) { flag = true; d = -d; }

	d *= 1000;
	d += 0.5;

	int t1 = (int)d;
	double t2 = d - (double)t1;
	d -= t2;

	d /= 1000;

	if (flag) { d = -d; }

	return d;
}

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


using namespace std;
#define RENT 100000

int main(){
  int n;
  int cnt=0;

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

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

    if(x==0)x=0;
    if(y==0)y=0;

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

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

int main(){
	double A[2][3],x,y,i;

	/*
	printf("6つの実数を入力してください 例:6 3 4 8 9 1\n");
	scanf("%lf%lf%lf%lf%lf%lf",&A[0][0],&A[0][1],&A[0][2],&A[1][0],&A[1][1],&A[1][2]);

	printf("連立方程式%lfx+%lfy=%lf,%lfx+%lfy=%lfを解きます\n",A[0][0],A[0][1],A[0][2],A[1][0],A[1][1],A[1][2]);
	*/

	while(scanf("%lf%lf%lf%lf%lf%lf",&A[0][0],&A[0][1],&A[0][2],&A[1][0],&A[1][1],&A[1][2]) != EOF){
	
		//掃き出し法で
		for(i=2;i>=0;i--){
			A[0][i] /= A[0][0];
		}
	
		for(int i=2;i>=0;i--){
			A[1][i] -= A[0][i] * A[1][0];
		}

		if(A[1][1] == 0){
			if(A[1][2] == 0){
				printf("解はすべての実数\n");
			}else{
				printf("解無し\n");
			}
			return 0;
		}

		y = A[1][2] / A[1][1];
		x = A[0][2] - A[0][1]*y;

		printf("x = %lf ,y = %lf\n",x,y);

		x *= 1e+3;
		y *= 1e+3;

		//切上げ処理
		x = floor(x+0.5)*(1e-3);
		y = floor(y+0.5)*(1e-3);

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

	return 0;
}