Go: package main

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

var sc = bufio.NewScanner(os.Stdin)

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

func main() {
	sc.Split(bufio.ScanLines)
	for sc.Scan() {
		s := strings.Split(sc.Text(), " ")
		a, _ := strconv.ParseFloat(s[0], 64)
		b, _ := strconv.ParseFloat(s[1], 64)
		c, _ := strconv.ParseFloat(s[2], 64)
		d, _ := strconv.ParseFloat(s[3], 64)
		e, _ := strconv.ParseFloat(s[4], 64)
		f, _ := strconv.ParseFloat(s[5], 64)
		x := ((b * f) - (c * e)) / ((b * d) - (a * e))
		y := ((a * f) - (c * d)) / ((a * e) - (b * d))
		if x == 0 {
			fmt.Printf("0.000 %.3f\n", y)
		} else if y == 0 {
			fmt.Printf("%.3f 0.000\n", x)
		} else {
			fmt.Printf("%.3f %.3f\n", x, y)
		}
	}
}

C++: #include<iostream>
#include<cstdio>
#include<vector>
#include<string>
#include<algorithm>

#define doubled( x ) (x * x)

//?????????????¨????(2 * 2??£?????????)
int matrix_val(int a11, int a12, int a21, int a22);

//?????°?????°?????? (in:??´??° out:?????°)
int digit_count(int num);

using namespace std;

int main()
{
	int a, b, c, d, e, f;
	
	cin >> a >> b >> c ;
	cin >> d >> e >> f;
	do
	{
		int ans_x = matrix_val(c, b, f, e) / matrix_val(a, b, d, e);
		int ans_y = matrix_val(a, c, d, f) / matrix_val(a, b, d, e);
		
		cout << ans_x << ans_y << endl;
	}while( (cin >> a >> b >> c >> d >> e >> f) );
	
	return 0;
}

int matrix_val(
int a11, int a12,
int a21, int a22
){
	return ((a11 * a22) - (a12 * a21));
}

int digit_count(int num)
{
	if( num < 0 )num *= (-1);
	
	int count = 0;
	
	for(int i = 10; num != 0; i *= 10)
	{
		int diff = num % i;
		num -= diff;
		count++;
	}
		
	return count;
}

C++: #include <cmath>
#include <iomanip>
#include <ios>
#include <iostream>
#include <sstream>
#include <string>

using namespace std;

int main()
{
    string s;
    while (getline(cin, s)) {
        stringstream ss;
        ss << s;
        int a, b, c, d, e, f;
        ss >> a >> b >> c >> d >> e >> f;

        auto det = [](int a00, int a01, int a10, int a11) -> double {
            return a00 * a11 - a01 * a10;
        };

        auto x1 = round(det(c, b, f, e) / det(a, b, d, e) * 1000.0) / 1000.0;
        auto x2 = round(det(a, c, d, f) / det(a, b, d, e) * 1000.0) / 1000.0;
        if (x1 == 0.0) {
            x1 = 0.0;
        }
        if (x2 == 0.0) {
            x2 = 0.0;
        }
        //stringstream tmp;
        //tmp << setprecision(4) << fixed << x1 << ' ' << x2 << endl;
        //double o1, o2;
        //tmp >> o1 >> o2;
        cout << setprecision(4) << fixed << x1 << ' ' << x2 << endl;
    }
}

C++: //
//  main.cpp
//  b
//
//  Created by h3037178 on 2017/07/31.
//  Copyright ?? 2017??´ ?????£?????????. All rights reserved.
//

#include <iostream>
#include<algorithm>
#include<math.h>
#include<stdio.h>
using namespace std;
int main(){
    float a,b,c,d,e,f,x,y;
    while(cin>>a>>b>>c>>d>>e>>f){
        x=(c*e-f*b)/(a*e-b*d);
        y=(c*d-f*a)/(b*d-a*e);
        if(x<-0.0005){
            x=0.000;
        }
        if(y<-0.0005){
            y=0.000;
        }
        printf("%.3f %.3f\n",x,y);
    }
}

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

double round(double src,int n);

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

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

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

double round(double src,int n){
    double p = src * pow(10,n-1);
    p = floor(p+0.5);
    p = p * pow(10,-(n-1));
    return p;
    
}

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

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

double x(double, double, double, double, double, double) {

	return (c*e - b*f) / (a*e - b*d);
}

double y(double, double, double, double, double, double) {

	return (a*f - c*d) / (a*e - b*d);
}

double round(double dat, int keta){
	int fct;

	fct = (int)pow(10, keta - 1);
	dat *= fct;
	dat += (dat < 0) ? -0.5 : 0.5;
	dat = (int)(dat);
	dat /= fct;
	return dat;
}

int main()
{
	double x1, x2, y1, y2;
	cin >> a >> b >> c >> d >> e >> f;

	x1 = x(a, b, c, d, e, f);
	y1 = y(a, b, c, d, e, f);

	cin >> a >> b >> c >> d >> e >> f;

	x2 = x(a, b, c, d, e, f);
	y2 = y(a, b, c, d, e, f);

	cout << fixed << setprecision(3) << round(x1,3) << " " << round(y1,3) << endl;
	cout << fixed << setprecision(3) << round(x2,3) << " " << round(y2,3) << endl;

	return 0;
}

C++: #include<stdio.h>

int main(){
	double x1,y1,z1,x2,y2,z2,num1=0,x=0,y=0,z=0,sum1=0,sum2=0,vx=0,vy=0,vz=0;
	
	while(scanf("%lf %lf %lf %lf %lf %lf",&x1,&y1,&z1,&x2,&y2,&z2)!=EOF){
	
	
	
	
	
	if((x1>0&&x2>0)||(x1<0&&x2>0)){
		num1=x2/x1*-1;
	}
	else if((x1>0&&x2<0)||(x1<0&&x2<0)){
		num1=x2/x1;
	}
	
	
	
	vx=x1*num1;
	vy=y1*num1;
	vz=z1*num1;
	
	x=vx+x2;
	y=vy+y2;
	z=vz+z2;
		
	sum2=z/y;
	sum1=(z2-y2*sum2)/x2;
	
	
	
	
	if(sum1>=0){
	sum1=(int)(sum1*1000+0.5);
	sum1=(double)(sum1/1000);
	}
		else if(sum1<0){
	sum1=(int)(sum1*1000-0.5);
	sum1=(double)(sum1/1000);
	}
	if(sum2>=0){
	sum2=(int)(sum2*1000+0.5);
	sum2=(double)(sum2/1000);
	}
		else if(sum2<0){
	sum2=(int)(sum2*1000-0.5);
	sum2=(double)(sum2/1000);
	}
	
	
	
	printf("%.3f %.3f\n",sum1,sum2);
	
	}
		
	return 0;
}

C++: #include<cmath>
#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){
    y = (a*f-d*c)/(a*e-b*d);
    x = (c-b*y)/a;
    printf("%.3f %.3f\n",x,y);
  }
}

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

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

using namespace std;

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

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

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

C++: #include <iomanip>
#include <iostream>
#include <vector>
#define N 2
 
using namespace std;
typedef vector< vector<double> > Equation;
 
int main()
{ 
    Equation c(N, vector<double>(N + 1));
	while (cin)
	{
		// input
		for (int i = 0; i < N; ++i)
			for (int j = 0; j < N + 1; ++j)
				cin >> c[i][j];

		// 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];
        }
 
		for (int i = 0; i < N; ++i)
			if (c[i][N] < -0.001)
				c[i][N] = 0;

        cout << setprecision(3) << 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;
const double EPS = 1e-10;

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