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 <stdio.h>

#define X 0
#define Y 1
#define C 2
#define SIKI1 0
#define SIKI2 1
#define LEFT  0
#define RIGHT 1

int main(){
	double A[3][3][3];
	int n[6];

	while( scanf("%d %d %d %d %d %d",&n[0],&n[1],&n[2],&n[3],&n[4],&n[5]) != EOF){
		//ÏÌú»
		for(int i=0 ; i<=RIGHT ; i++){
			for(int j=0 ; j<=SIKI2 ; j++){
				for(int k=0 ; k<=C ; k++){
					A[i][j][k] = 0;
				}
			}
		}

		//lÌãü
		A[LEFT][SIKI1][X]  = n[0];
		A[LEFT][SIKI1][Y]  = n[1];
		A[RIGHT][SIKI1][C] = n[2];
		A[LEFT][SIKI2][X]  = n[3];
		A[LEFT][SIKI2][Y]  = n[4];
		A[RIGHT][SIKI2][C] = n[5];

		//®PÌXð¶Ó©çEÓÖÚ·é
		A[ RIGHT ][ SIKI1 ][ X ]  += (-1.0)*(A[ LEFT ][ SIKI1 ][ X ]);
		A[ LEFT  ][ SIKI1 ][ X ]  = 0;

		//®PÌ¼ÓðYÌWÅé		
		A[ RIGHT ][ SIKI1 ][ X ]  /= A[ LEFT ][ SIKI1 ][ Y ];
		A[ RIGHT ][ SIKI1 ][ C ]  /= A[ LEFT ][ SIKI1 ][ Y ];
		A[ LEFT  ][ SIKI1 ][ Y ]  = 1;

		//®QÌYÉãüµÄ®Qð(ax = b)Ì`É·é
		int a = A[ LEFT ][ SIKI2 ][ Y ];
		A[ LEFT  ][ SIKI2 ][ X ]  += a * A[ RIGHT ][ SIKI1 ][ X ];
		A[ LEFT  ][ SIKI2 ][ Y ]   = 0;
		A[ RIGHT ][ SIKI2 ][ C ]  += a * A[ RIGHT ][ SIKI1 ][ C ] * (-1.0);
		//XYÌðªÜé
		double answerX = A[ RIGHT ][ SIKI2 ][ C ] / A[ LEFT ][ SIKI2 ][ X ];
		double answerY = (n[2] + n[0]*answerX*(-1.0))/n[1];
		
		//¬æSÊðlÌÜü·é
		if( (((int)(answerX*10000))%10) >= 5){
			answerX += 0.001;
		}
		if( (((int)(answerY*10000))%10) >= 5){
			answerY += 0.001;
		}
		if(answerX==-0.0){
			answerX = 0;
		}
		if(answerY==-0.0){
			answerY = 0;
		}
		//ðÌoÍ
		printf("%.6f %.6f\n", answerX , answerY);
	}

	return 0;
}

C++: #include <cstdio>

int main()
{
        float A[2][2], B[2];

        while (scanf("%f %f %f %f %f %f",
                                 &A[0][0], &A[0][1], &B[0],
                                 &A[1][0], &A[1][1], &B[1]) != EOF) {
                float det = A[0][0] * A[1][1] - A[0][1] * A[1][0];
                float invA[2][2];
                invA[0][0] = A[1][1] / det;
                invA[0][1] = -A[0][1] / det;
                invA[1][0] = -A[1][0] / det;
                invA[1][1] = A[0][0] / det;
                float ans[2] = {0, 0};
                for (int i = 0; i < 2; i++) {
                        for (int j = 0; j < 2; j++) {
                                ans[i] += B[j] * invA[i][j];
                        }
                }

                printf("%.3f %.3f\n", ans[0], ans[1]);
        }
        return 0;
}

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

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

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


        double x = 0.0;
        if (c*e - b*f != 0)
            x = static_cast<double>(c*e - b*f) / (a*e - b*d);
        double y = 0.0;
        if (a*f - c*d != 0)
            y = static_cast<double>(a*f - c*d) / (a*e - b*d);
        cout.setf(ios_base::fixed, ios_base::floatfield);
        cout << std::setprecision(3) << x << " " << y << endl;
    }
}

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

int main(){
	double a[6];
	double x,y;
	while(true){
		cin >> a[0];
		cin >> a[1];
		cin >> a[2];
		cin >> a[3];
		cin >> a[4];
		cin >> a[5];
		if(cin.eof())
			break;
			
		x = (a[4]*a[2]-a[1]*a[5])/(a[0]*a[4]-a[1]*a[3]);
		y = (-a[3]*a[2]+a[0]*a[5])/(a[0]*a[4]-a[1]*a[3]);
		
		cout << setprecission(3) << x << " " <<setprecision(3) << y << endl;
	}
	return 0;
}

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

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

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

C++: #include<stdio.h>
int main(){
	int X,Y;
double a,b,c,d,e,f,x,y;
double p[2][3]={0};
y=0;x=0;
while(scanf("%lf",&a)!=0){
scanf("%lf",&b);scanf("%lf",&c);
scanf("%lf",&d);scanf("%lf",&e);scanf("%lf",&f);
y=(d*c-a*f)/(b*d-a*e);
x=(e*c-b*f)/(e*a-b*d);
X=x*10000;
Y=y*10000;
if((X)%10>=5)x+=0.0005;
else if((X)%10<=-5)x-=0.0005;
if((Y)%10>=5)y+=0.0005;
else if((Y)%10<=-5)y-=0.0005;

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

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

using namespace std;

int main(int argc, char *argv[]) {
  double a, b, c, d, e, f;

  while (true) {
    cin >> a >> b >> c >> d >> e >> f;
    if (cin.eof())
      break;
    a -= d * b / e;
    c -= f * b / e;
    double x = c / a;
    if (x >= 0)
      x = (int)(x * 100 + 0.5);
    else
      x = (int)(x * 100 - 0.5);
    x /= 100;
    double y = (f - d * x) / e;
    if (y >= 0)
      y = (int)(y * 100 + 0.5);
    else
      x = (int)(y * 100 - 0.5);
    y /= 100;
    printf("%.3lf %.3lf\n", x, y;
  return 0;
}

C++: #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
using namespace std;

typedef long long ll;
typedef pair<int, int> P;

#define all(c) (c).begin(), (c).end()
#define pb push_back
#define mp make_pair
#define EXIST(v,i) (find(all(v), i) != (v).end())
#define ERASE(v,i) (v).erase(remove(all(v), i), (v).end())
#define INDEX(v,i) (find(all(v), i) - (v).begin())
#define rep(i,n) for(int i = 0; i < (int)n; ++i)
#define debug(x) cerr << #x << " = " << (x) << endl;

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

const int INF = 100000000;
const double PI = 3.14159265358979323846;
const double EPS = 1e-10;

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

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

using namespace std;

double solutionY();
double solutionX(double);
double a1,b1,c1,d1,e1,f1;

int main(){
  
  while(cin){
    cin >> a1 >> b1 >> c1 >> d1 >> e1 >> f1;
    double x,y;
    
    y = solutionY();
    x = solutionX(y);
    
    cout << fixed << setprecision(3) << x << " " << y << endl ; 
  }
  return 0;
}

double solutionY(){
  double b,c,e,f;
  b = b1/a1;
  c = c1/a1;

  e = e1/d1;
  f = f1/d1;
  
  return (c - f)/(b - e);
}

double solutionX(double y){
  double b,c;
  b = b1/a1;
  c = c1/a1;
  
  return (c - b*y);
}

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

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

using namespace std;

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

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

    return 0;
}