Go: package main

import (
  "fmt"
)

func main() {
  var a,b,c,d,e,f float64
  var x,y float64
  for _, err := fmt.Scan(&a, &b, &c, &d, &e, &f); err == nil;
   _, err = fmt.Scan(&a, &b, &c, &d, &e, &f) {
    y = (a*f-c*d)/(a*e-b*d)
    x = (c-b*y)/a
    fmt.Printf("%.3f %.3f\n", x,y)
  }
}

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

#define ROUND_RANK 4

//ax+by=c
//dx+ey=f

//行列式の算出
double Calc_det(const double& p11, const double& p12, const double& p21, const double& p22) {
	return (p11*p22 - p12*p21);
}
//xの解の算出
double Calc_x(const double& det, const double& q1, const double& p22, const double& p12, const double& q2) {
	return ((q1*p22 - p12*q2) / det);
}
//yの解の算出
double Calc_y(const double& det, const double& q2, const double& p11, const double& q1, const double& p21) {
	return ((q2*p11 - p21*q1) / det);
}
//少数点以下第rank位で四捨五入
double Round(const double& value, const int& rank) {
	int root = pow(10, rank);
	return (std::round(value*root) / root);
}

int main() {
	double	a, b, c, d, e, f;//データセット
	double  det;//行列式
	double	x, y;//解
	std::cin >> a >> b >> c >> d >> e >> f;
	det = Calc_det(a, b, d, e);
	det = fabs(det);
	x = Calc_x(det, c, e, b, f);
	y = Calc_y(det, a, f, c, d);
	x = Round(x, ROUND_RANK);
	y = Round(y, ROUND_RANK);
	std::cout << std::fixed;
	std::cout << std::setprecision(3) << x << " ";
	std::cout << std::setprecision(3) << y << std::endl;
}

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

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

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

		cout << x << ' ' << y << endl;
	}

	return 0;
}

C++: #include<iostream>
#include<iomanip>
#define x_Formula(a,b,c,d,e,f) (c-(b*f)/e)/(a-(b*d)/e);
#define y_Formula(x,a,b,c) (c-(a*x))/b;

using namespace std;

double x;
double y;

void serch()
{
	int xx,yy;
	xx=x*10000;
	yy=y*10000;
//	cout << xx << " " << yy << endl;
	if(xx>0)
		xx+=5;
	else
		xx-=5;
	if(yy>0)
		yy+=5;
	else
		yy-=5;
	x=xx/10000;
	y=yy/10000;
//	cout << xx << " " << yy << endl;

}
int main()
{
	double num[6];
	int i;
	
	for(;cin >> num[0];)
	{
		for(i=1;i<6;i++)
			cin >> num[i];
		
		x=x_Formula(num[0],num[1],num[2],num[3],num[4],num[5])
		y=y_Formula(x,num[0],num[1],num[2])
		
		cout << setprecision(3);
		cout << setiosflags(ios::scientific);
		cout << fixed ;
		serch();
		cout << x << " " << y << endl;
	}
}

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

using namespace std;

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

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

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

using namespace std;

double EPS = 1e-9;

int gcd(int a, int b) { return b != 0 ? gcd(b, a%b) : a; }

int main() {
	double a, b, c, d, e, f;
	
	while (cin >> a >> b >> c >> d >> e >> f) {
		double x, y;
		
		int div1 = gcd(a, b), div2 = gcd(b, d);
		int div = gcd(div1, div2);
		a /= div; b /= div; c /= div;
		
		div1 = gcd(d, e); div2 = gcd(e, f);
		div = gcd(div1, div2);
		d /= div; e /= div; f /= div;
		
		y = (c - a*f/d)/(b - a*e/d);
		if (fabs(y) < EPS) y = 0.0;
		
		x = (c - b*y)/a;
		if (fabs(x) < EPS) x = 0.0;
		
		printf("%.3lf %.3lf\n", x, y);
	}
	
	return 0;
}

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

using namespace std;

const double EPS = 1e-6;

int main() {
	double a, b, c, d, e, f;
	while(cin >> a >> b >> c >> d >> e >> f) {
		double det = a * e - d * b;
		double x = (c * e - b * f) / det, y = (a * f - d * c) / det;
		x = round(x * 1000) / 1000;
		y = round(y * 1000) / 1000;
		if(signbit(x) && abs(x - 0) < EPS) x *= -1;
		if(signbit(y) && abs(y - 0) < EPS) y *= -1;
		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, z;
	int i;
	while (scanf("%lf", &a) != EOF) {
		scanf("%lf %lf %lf %lf %lf", &b, &c, &d, &e, &f);
		z = d / a;
		b *= z;
		c *= z;
		y = (c - f) / (b - e);
		x = (f - e*y) / d;
		printf("%.3f %.3f\n", x, y);
	}
	return 0;
}

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;
}