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<iostream>
#include<cstdio>
using namespace std;

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

C++: #include <iostream> 
#include <cstdio>
using namespace std;
const int n = 1000100;
double a[n], b[n], c[n], d[n], e[n], f[n], x[n], y[n]; 
int main () {
	int count = 1;
	while (cin >> a[count] >> b[count] >> c[count] >> d[count] >> e[count] >> f[count]) count++;

	for (int i = 1; i < count; i++) {
		x[i] = (c[i] * e[i] - b[i] * f[i]) / (a[i] * e[i] - b[i] * d[i]);
		y[i] = (a[i] * f[i] - c[i] * d[i]) / (a[i] * e[i] - b[i] * d[i]);
		x[i] = (int)(10000 * x[i] + 5) / 10000;
		y[i] = (int)(10000 * y[i] + 5) / 10000;
		printf ("%.3f %.3f\n", x[i], y[i]);
	}
	
	return 0;
}

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

int main(){
  for(double a1,b1,c1,d1,e1,f1,b2,c2,e2,f2,a3,c3,d3,f3,x,y;cin>>a1>>b1>>c1>>d1>>e1>>f1;){

    b2=b1*d1;
    c2=c1*d1;

    e2=a1*e1;
    f2=a1*f1;

    y=(c2-f2)/(b2-e2);

    a3=a1*e1;
    c3=c1*e1;

    d3=b1*d1;
    f3=b1*f1;

    x=(c3-f3)/(a3-d3);

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

C++: #include<cstdio>
#include<algorithm>
#include<cmath>

using namespace std;

int main(){
        double a, b, c, d, e, f, g, h, i, j, k, l, m, n, x, y;

        while(scanf("%lf%lf%lf%lf%lf%lf", &a, &b, &c, &d, &e, &f) != EOF){
                g = a * d;      //公倍数
                j = b;
                k = c;
                l = a;
                b *= g / a;
                c *= g / a;
                e *= g / d;
                f *= g / d;
                a *= g / a;
                d *= g / d;

                h = b - e;
                i = c - f;

                y = i / h;
                x = k - y * j;
                x /= l;
                y *= 1000;
                y = floor(y + 0.5);
                y /= 1000;
                x *= 1000;
                x = floor(x + 0.5);
                x /= 1000;

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

        return 0;
}

C++: #include<iostream>
#include<stdio.h>
using namespace std;
int main(){
  int a,b,c,d,e,f;
  double x,y;
  while(cin>>a>>b>>c>>d>>e>>f)
    {
      x=1.0*(c*e-b*f)/(a*e-b*d)+0.0001;
	y=(c-a*x)/b+0.0001;
	printf("%.3f %.3f\n",x,y);
    }}

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

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

int main(){
	double a[6];
	double x,y;
	while(cin>>a[0]>>a[1]>>a[2]>>a[3]>>a[4]>>a[5]){
		double b=a[0]*a[4]-a[1]*a[3];
		double c=a[0];
		a[0]=a[4];
		a[4]=c;
		a[1]*=-1.0;
		a[3]*=-1.0;
		x=(a[0]*a[2]+a[1]*a[5])/b;
		y=(a[3]*a[2]+a[4]*a[5])/b;
		if(x==-0.0)x=0.0;
		if(y==-0.0)y=0.0;
		printf("%.3f %.3f\n",x,y);
	}
	


	return 0;
}

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

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

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

	int i = 0;
	while(cin >> a[i] >> b[i] >> c[i] >> d[i] >> e[i] >> f[i]) {
		if(a[i] != 0 && b[i] != 0 && d[i] != 0 && e[i] != 0) {
			x[i] = (b[i]*f[i]-e[i]*c[i])/(b[i]*d[i]-a[i]*e[i]);
			y[i] = (d[i]*c[i]-a[i]*f[i])/(b[i]*d[i]-a[i]*e[i]);
		} else {
			if(a[i] == 0) {
				y[i] = c[i]/b[i];
				x[i] = (f[i]-e[i]*y[i])/d[i];
			} else if(b[i] == 0) {
				x[i] = c[i]/a[i];
				y[i] = (f[i]-d[i]*x[i])/e[i];
			} else if(d[i] == 0) {
				y[i] = f[i]/e[i];
				x[i] = (c[i]-b[i]*y[i])/a[i];
			} else if(e[i] == 0) {
				x[i] = f[i]/d[i];
				y[i] = (c[i]-a[i]*x[i])/b[i];
			}
		}
		i++;
	}

	for(int j=0; j<i; j++) cout << fixed << setprecision(3) << x[j] << " " << y[j] << endl;

	return 0;
}

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

using namespace std;

int main() {

	double ans[4], coe[12];
	int i;

	for (i = 0; i < 12; i++) 
		cin >> coe[i];
	ans[0] = (coe[2] * coe[4] - coe[1] * coe[5]) / (coe[0] * coe[4] - coe[1] * coe[3]);
	ans[1] = (coe[2] * coe[3] - coe[0] * coe[5]) / (coe[1] * coe[3] - coe[0] * coe[4]);
	ans[2] = (coe[8] * coe[10] - coe[7] * coe[11]) / (coe[6] * coe[10] - coe[7] * coe[9]);
	ans[3] = (coe[8] * coe[9] - coe[6] * coe[11]) / (coe[7] * coe[9] - coe[6] * coe[10]);
	
	printf("%.3f %.3f\n", ans[0], ans[1]);
	printf("%.3f %.3f\n", ans[2], ans[3]);

	return 0;

}

C++: #include "stdio.h"
#include "math.h"

#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <cstring>
#include <string>
#include <sstream>
#include <algorithm>
#include <iomanip>
#include <iostream>

#define VARIABLE(x) cerr << #x << "=" << x << endl
#define BINARY(x) cerr << #x << "=" << static_cast<bitset<16> >(x) << endl;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for (int i=m;i<(int)(n);i++)

const int INF = 10000000;
int dx[4]={1, 0, -1, 0}, dy[4]={0, 1, 0, -1};
using namespace std;
typedef long long  ll;

int main()
{
	double a, b, c, d, e, f;
	while (cin>>a>>b>>c>>d>>e>>f) {
		double x, y;
		
		x = 1/(a*e-b*d)*(c*e-b*f);
		y = 1/(a*e-b*d)*(f*a-c*d);
		
		if (x == -0.0) x = 0.0;
		if (y == -0.0) y = 0.0;
		
		//cout << x << " " << y << endl;
		printf("%.3f %.3f\n", x, y);
	}
}

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

}

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

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

	while(cin >> a >> b >> c >> d >> e >> f){
		float x, y;
		x = (float)(b*f - c*e)/(b*d -a*e);
		y = (float)(c - a*x)/b;
		cout << x << " " << y << endl;
	}
	return 0;
}

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