Go: package main

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

var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func main() {
	sc.Split(bufio.ScanWords)
	defer out.Flush()
	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 float64(((c * e) - (b * f)) / ((a * e) - (b * d)))
}

func GetY(a, b, c, d, e, f float64) float64 {
	return float64(((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 <iomanip>
#include <iostream>
#include <vector>
#define N 2
 
using namespace std;
typedef vector< vector<double> > Equation;
 
bool input(Equation& c)
{
	if (!cin) return false;

    for (int i = 0; i < N; ++i)
        for (int j = 0; j < N + 1; ++j)
            cin >> c[i][j];
 
    return true;
}
 
int main()
{
    Equation c(N, vector<double>(N + 1));
	while (cin >> c[0][0] >> c[0][1] >> c[0][2] >> c[1][0] >> c[1][1] >> c[1][2])
	{
		// Gaussian elimination
		// 1. Forward elimination
        for (int i = 0; i < N - 1; ++i)
            for (int j = i + 1; j < N; ++j)
            {
                double d = c[j][i] / c[i][i];
                for (int k = i + 1; k <= N; ++k)
                    c[j][k] -= c[i][k] * d;
            }
 
		// 2. Back substitution
        for (int i = N - 1; i >= 0; --i)
        {
            double d = c[i][N];
            for (int j = i + 1; j < N; ++j)
                d -= c[i][j] * c[j][N];
            c[i][N] = d / c[i][i];
        }
 
        cout << setprecision(4) << fixed << c[0][N];
        for (int i = 1; i < N; ++i)
            cout << " " << c[i][N];
        cout << endl;
    }
 
    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  double a[2][3];
  bool f=0;
  while(cin>>a[0][0]>>a[0][1]>>a[0][2]>>a[1][0]>>a[1][1]>>a[1][2]){
    if(a[0][0]==0)
      for(int i=0;i<3;i++)swap(a[0][i],a[1][i]),f=1;
    for(int i=0;i<2;i++){
      for(int j=i+1;j<3;j++)
	a[i][j]/=a[i][i];
      a[i][i]=1;
      for(int j=0;j<2;j++){
	if(j==i)continue;
	double t=a[j][i];
	for(int k=i;k<3;k++)
	  a[j][k]-=t*a[i][k];
      }
    }
    printf("%.3f %.3f\n",a[0][2],a[1][2]);
  }
  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 x = (c * e - b * f) / (a * e - b * d);
        double y = (a * f - c * d) / (a * e - b * d);
        x *= 1000; x = x + (x > 0 ? 0.5 : -0.5); x = (int)x;
        y *= 1000; y = y + (y > 0 ? 0.5 : -0.5); y = (int)y;
        printf("%.3f %.3f\n", x / 1000, y / 1000);
    }
    return 0;
}

C++: #include <stdio.h>

int main()
{
	int a,b,c,d,e,f;
	double def;
	double x,y;
	while(scanf("%d %d %d %d %d %d",&a, &b, &c, &d, &e, &f) != EOF){
		if((a * e - b * d) != 0){
			def = 1 / (double)(a * e - b * d);
		}else{
			printf("NA\n");
			continue;
		}
		x = def * (double)(e * c - b * f);
		y = def * (double)(a * f - d * c);
		printf("%lf %lf\n",x,y);
	}
	return 0;
}

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

double get_num(double x){
	x = x * 1000;
	if(x >= 0){
		x = (int)(x + 0.5);
		return ((double)x / 1000);
	} else {
		x = (int)(x - 0.5);
		return ((double)x / 1000);
	}
}

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

C++: include <stdio.h>

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

    while(scanf("%lf%lf%lf%lf%lf%lf", &a, &b, &c, &d, &e, &f) != EOF) {
        x = (c*e-b*f)/(a*e-b*d);
        y = (a*f-c*d)/(a*e-b*d);
        printf("%.3lf %.3lf\n", x, y);
    }

    return 0;
}

C++: #include<stdio.h>
#include<math.h>
void solution(int a,int b,int c,int d,int e,int f);
double x,y;
int main()
{
    int a,b,c,d,e,f;
    while(scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f)==6)
    {
        solution(a,b,c,d,e,f);
        printf("%0.3lf %0.3lf\n",x,y);
    }
    return(0);
}
void solution(int a,int b,int c,int d,int e,int f)
{
    double number_1,number_2,number_3,correction;
    number_1=c*e-b*f;
    number_2=a*f-c*d;
    number_3=a*e-b*d;
    if((number_1==0)&&(number_3<0)&&(number_2!=0))
    {
        correction=-1*number_3;
        x=number_1/correction;
        y=number_2/number_3;
    }
    else if((number_2==0)&&(number_3<0)&&(number_1!=0))
    {
        correction=-1*number_3;
        x=number_1/number_3;
        y=number_2/correction;
    }
    else if((number_1==0)&&(number_3<0)&&(number_2==0))
    {
        correction=-1*number_3;
        x=number_1/correction;
        y=number_2/correction;
    }
    else
    {
        x=number_1/number_3;
        y=number_2/number_3;
    }
    return;
}

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

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

C++: #include<iostream>
#include<stdio.h>
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;


		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,x,y;
  while(scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f) != EOF){
    x = (a*f - c+d)/(a*e - d*b);
    y = (c -b*y)/a;
    printf("%.3f %.3f",x,y);
  }
}

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

void solve_SE(double* x, double a, double b, double c, double d, double e, double f)
{
    x[0] = (c * e - f * b) / (a * e - d * b);
    x[1] = (c * d - f * a) / (b * d - e * a);
}

int main()
{
    double a, b, c, d, e, f;
    double x[2];
    while (cin >> a >> b >> c >> d >> e >> f) {
        solve_SE(&x[0], a, b, c, d, e, f);
        for (int i = 0; i < 2; i++) {
            x[i] *= 1000;
            if (x[i] > 0)
                x[i] += 0.5;
            else
                x[i] -= 0.5;
            x[i] = static_cast<int>(x[i]) / 1000;
        }
        cout << fixed << setprecision(3) << x[0] << ' ' << x[1] << endl;
    }
}

C++: /* -*- coding:utf-8 -*- */

#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <cmath>

using namespace std;

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


  while(cin >> a >> b >> c >> d >> e >> f, !cin.eof()) {
    cout << "\n";
    double x,y;
    x = (e*c-b*f)/(a*e-b*d);
    y = (-c*d+a*f)/(a*e-b*d);
    cout << fixed << setprecision(3) << showpoint << ((fabs(x) < 1e-4) ? 0 : x) << ' ' << ((fabs(y) < 1e-4) ? 0 : y) << endl;
  }
  return 0;
}