Go: package main

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

func main() {
        var a, b, c, d, e, f float64
        sc := bufio.NewScanner(os.Stdin)
        for sc.Scan() {
                fmt.Sscanf(sc.Text(), "%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f)

                det := a*e - b*d
                x := (e*c - b*f) / det
                y := (a*f - c*d) / det
                if x == 0.0 {
                        x = math.Abs(x)
                }
                if y == 0.0 {
                        y = math.Abs(y)
                }
                fmt.Printf("%.3f %.3f\n", x, y)
        }
}

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

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    vector<double> a, b, c, d, e, f;
    int i = 0;
    while(cin) {
        double ai, bi, ci, di, ei, fi;
        cin >> ai >> bi >> ci >> di >> ei >> fi;
        a.push_back(ai);
        b.push_back(bi);
        c.push_back(ci);
        d.push_back(di);
        e.push_back(ei);
        f.push_back(fi);
        i++;
    }
    
    for(int j=0; j+1<i; j++) {
        double ai = a[j];
        double bi = b[j];
        double ci = c[j];
        double di = d[j];
        double ei = e[j];
        double fi = f[j];
        
        double x = (bi * fi / ei + 0.0 - ci) / ( bi * di / ei + 0.0 - ai);
        double y = (ci - ai * x) / bi;
        if(x == -0) x = 0;
        if(y == -0) y = 0;
        cout << fixed << setprecision(3) << x << " " << y << endl;
    }
    return 0;
}

C++: #include <bits/stdc++.h>
// #include "bits/stdc++.h"

#define pout(n)  printf ("%d\n", n)

#define rep(i,a,n) for (int i = a;i < n;i++)
#define per(i,n,a) for (int i = n-1;i >= a;i--)

const int d4x[4] = {1, 0, -1, 0};
const int d4y[4] = {0, 1, 0, -1};
const int d8x[8] = { 1,1,0,-1,-1,-1,0,1 };
const int d8y[8] = { 0,1,1,1,0,-1,-1,-1 };
 
typedef long long ll;
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-a*f)/(b*d-a*e);
    x = (c-b*y)/a;
    printf("%.3f %.3f\n",x,y);
  }
  

  return 0;
}

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

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

C++: #include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
int main() {
  int a, b, c, d, e, f;
  double x, y;
  while (cin >> a >> b >> c >> d >> e >> f) {
    x = (b * f - c * e) / (b * d - a * e);
    y = (a * f - c * d) / (a * e - b * d);
    printf("%.3f %.3f\n", x + 0.0001, y + 0.0001);
  }
  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 ){
		x = (c*e - b*f) / (a*e - b*d);
		y = (c*d - a*f) / (b*d - a*e);
		if( fabs(x) < 0.0005 ) x = 0.0;
		if( fabs(y) < 0.0005 ) y = 0.0;
		cout << fixed << std::setprecision(3) << x << " " << y << "\n";
	}
	return 0;
}

C++: #include <bits/stdc++.h>	//C++標準ライブラリ一括読み込み
using namespace std;

// ax+by=c
// dx+ey=f
double unko(double x){
	int y=int(round(x*1000));
	return double(y)/1000;
}

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

C++: #include<stdio.h>
int main()
{
    float a,b,c,d,e,f,q1,q2,x,y;
    while(scanf("%f%f%f%f%f%f",&a,&b,&c,&d,&e,&f)!=EOF)
    {
        if(b<0 && e<0)
        {
            q1=b;
            q2=e*(-1);
        }
        else if(b>0 && e>0)
        {
            q1=b*(-1);
            q2=e;
        }
        else if(b<0 && e>0)
        {
            q1=b*(-1);
            q2=e;
        }
        else if(b>0 && e<0)
        {
            q1=b;
            q2=e*(-1);
        }
        a=a*q2;b=b*q2;c=c*q2;
        d=d*q1;e=e*q1;f=f*q1;
        a=a+d;b=b+e;c=c+f;
        x=c/a;y=(f-(x*d))/e;
        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;
    while (cin>>a>>b>>c>>d>>e>>f) {
        double x = (c * e - f * b) / (a * e - d * b);
        double y = (c * d - f * a) / (b * d - a * e);

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

C++: #include <iostream>

using namespace std;

int main(){
	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 = (c*d - a*f) / (b*d - a*e);

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

C++: #include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef complex<double> P;
typedef pair<int,int> pii;
#define REP(i,n) for(ll i=0;i<n;++i)
#define REPR(i,n) for(ll i=1;i<n;++i)
#define FOR(i,a,b) for(ll i=a;i<b;++i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define MOD (ll)(1e9+7)
#define ADD(a,b) a=((a)+(b))%MOD
#define FIX(a) ((a)%MOD+MOD)%MOD

int main(){
  double a,b,c,d,e,f;
  while(~scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f)){
    // ax+by=c
    // dx+ey=f
    double x,y;
    x = (b*f-c*e)/(b*d-a*e);
    y = (c*d-a*f)/(b*d-a*e);
    if(abs(x)<1e-9) x = abs(x);
    if(abs(y)<1e-9) y = abs(y);
    // x = round(x*1000.0)/1000.0;
    // y = round(y*1000.0)/1000.0;
    printf("%.3lf %.3lf\n",x,y);
  }
  return 0;
}

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

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

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

	return 0;

}

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

int main(){
	double a,b,c,d,e,f,x,y;
	while(true){
		cin>>a>>b>>c>>d>>e>>f;
		if(cin.eof()) break;
		x=(b*f-c*e)/(b*d-a*e);
		y=(c-a*x)/b;
		x=round(x*1000.0)/1000.0;
		y=round(y*1000.0)/1000.0;
		if(x-0.0<0.001&&x-0.0>-0.001) x=0.0;
		if(y-0.0<0.001&&y-0.0>-0.001) y=0.0;
		printf("%.3f %.3f\n",x,y);
	}
	return 0;
}