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

int main(void){
	float a,b,c,d,e,f;
	float x,y,kei,right,data;
	
	while(scanf("%f %f %f %f %f %f",&a,&b,&c,&d,&e,&f)==6){
		if(a>d){
			kei=a/d;
			d*=kei;
			e*=kei;
			f*=kei;
		}
		if(a<d){
			kei=d/a;
			a*=kei;
			b*=kei;
			c*=kei;
		}
		
		y=b-e;
		right=c-f;
		y=right/y;
		
		data=y*b;
		c-=data;
		x=c/a;
		
		printf("%.3f %.3f\n",x,y);
	}
	
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

#define iota(i,n,b,s) for(int i=int(b);i!=int((b)+(s)*(n));i+=(s))
#define range(i,n,m) iota(i,(((n)>(m))?((n)-(m)+1):((m)-(n)+1)),(n),((n)>(m)?-1:1))
#define rep(i,n) iota(i,(n),0,1)

#define INF (1e9)
#define EPS (1e-9)
#define cons(a,b) (make_pair(a,b))
#define car(a) (a.first)
#define cdr(a) (a.second)
#define cadr(a) (car(cdr(a)))
#define cddr(a) (cdr(cdr(a)))
#define all(a) a.begin(), a.end()
#define trace(var) cerr<<">>> "<<#var<<" = "<<var<<endl;

typedef long long Integer;
typedef double Real;

template<class S, class T>
ostream& operator<<(ostream& os, pair<S,T> p) {
  os << '(' << car(p) << ", " << cdr(p) << ')';
  return os;
}

template<class T>
ostream& operator<<(ostream& os, vector<T> v) {
  os << v[0];
  for (int i=1, len=v.size(); i<len; ++i) os << ' ' << v[i];
  return os;
}

int dx[] = { -1, 0, 1, 0 };
int dy[] = {  0, -1, 0, 1 };

int main() {

  for (Real a,b,c,d,e,f; cin >> a >> b >> c >> d >> e >> f, cin; ) {

    Real det = a * e - b * d;
    Real x = e * c - b * f;
    Real y = - d * c + a * f;
    x /= det;
    y /= det;
    if (x == -0.0) x = 0.0;
    if (y == -0.0) y = 0.0;
    cout << x << ' ' << y << endl;

  }

  return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<iomanip>
#include<vector>
#include<math.h>
using namespace std;
class SimultaneousEquation{ 
    public:
        void solve(int a,int b,int c,int d,int e,int f){ 
            double x,y;
            x=double(c*e-b*f)/(a*e-b*d);
            y=double(c*d-a*f)/(b*d-a*e);
	    if(x==0)x=0;
	    if(y==0)y=0;
            printf("%.3lf %.3lf\n",fabs(x),fabs(y));
            }
};
int main(){ 
    int a,b,c,d,e,f;
    SimultaneousEquation inst;
    while(cin>>a>>b>>c>>d>>e>>f){
        inst.solve(a,b,c,d,e,f);
    }
}

C++: #include<iostream>
using namespace std;
int main(){
    float a,x,b,y,c,f,e,d;
    while(cin>>a>>b>>c>>d>>e>>f){
        x=(c-b*y)/c;
        x=(f-e*y)/d;
        y=(c-a*x)/b;
        y=(f-d*x)/e;
        cout<<x<<" "<<y<<endl;
    }
    
    return 0;
}

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

int main(){
  float a,b,c,d,e,f;
  float 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 <vector>

using namespace std;

int main(){
  double a,b,c,d,e,f;
  vector<double> al,bl,cl,dl,el,fl;
  double x,y,n,m;

  while(cin >> a >> b >> c >> d >> e >> f){
    al.push_back(a);
    bl.push_back(b);
    cl.push_back(c);
    dl.push_back(d);
    el.push_back(e);
    fl.push_back(f);
  }

  for(int i=0; i<al.size(); i++){
    n = bl[i]/el[i];
    m = al[i]/dl[i];
    x = (cl[i]-n*fl[i])/(al[i]-n*dl[i]); 
    y = (cl[i]-m*fl[i])/(bl[i]-m*el[i]);
    printf("%0.3f %0.3f\n", x, y);
    fflush(stdout);
  }

  return 0;
}

C++: #include <stdio.h>
#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

//substitution
int main() {

int a,b,c,d,e,f,x,y;

	while(1) {
		cin >> a >> b >> c >> d >> e >> f;
		if ( cin.eof() ) {
			break;
		}
	//a*x + b*y = c  and d*x + e*y = f
	
	 float y =(a*f - c*d)/(a*e - b*d);
	 float x =(c*e - b*f)/(a*e - b*d);

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

    return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cmath>
using namespace std; 
int main()
{
double a,b,c,d,e,f;
while(cin>>a>>b>>c>>d>>e>>f)
{
printf("%.3f %.3f\n", (b*f - c*e)/(b*d - a*e) + 0.0001, (a*f - c*d)/(a*e - b*d) + 0.0001);
}
return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
    double A[2][3];
    while(cin >> A[0][0] >> A[0][1] >> A[0][2] >> A[1][0] >> A[1][1] >> A[1][2]){
        for(int i = 1; i < 3; i++){
            A[0][i] /= A[0][0];
        }
        A[0][0] /= A[0][0];
        for(int i = 1; i < 3; i++){
            A[1][i] -= A[0][i] * A[1][0];
        }
        A[1][0] -= A[0][0] * A[1][0];
        for(int i = 0; i < 3; i++){
            if(i != 1)
                A[1][i] /= A[1][1];
        }
        A[1][1] /= A[1][1];
        for(int i = 0; i < 3; i++){
            if(i != 1)
                A[0][i] -= A[1][i] * A[0][1];
        }
        A[0][1] -= A[1][1] * A[0][1];
        
        printf("%.3f %.3f\n", A[0][2], A[1][2]);
    }
}

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;
scanf("%lf",&a);scanf("%lf",&b);scanf("%lf",&c);
scanf("%lf",&d);scanf("%lf",&e);scanf("%lf",&f);
/*for(int i=0;i<2;i++)
for(int j=0;j<3;j++)
{scanf("%d",&a);p[i][j]=a;}
y=(p[1][0]*p[0][2]-p[0][0]*p[1][2])/(p[1][0]*p[0][1]-p[0][0]*p[1][1]);
x=(p[1][1]*p[0][2]-p[0][1]*p[1][2])/(p[1][1]*p[0][0]-p[1][0]*p[0][1]);
*/
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 <iomanip>
using namespace std;

int main(){
	double a[6];
	double x,y;
	cout<< setprecision(4) << setiosflags(ios::showpoint);
	while(true){
		if(cin.eof())
			break;
		cin >> a[0];
		cin >> a[1];
		cin >> a[2];
		cin >> a[3];
		cin >> a[4];
		cin >> a[5];

			
		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]);
		if((-a[3]*a[2]+a[0]*a[5]) == -0)
			x = 0;
		if(a[4]*a[2]-a[1]*a[5] == -0)
			 y = 0;
			 
		cout << x << " " << y << endl;
	}
	return 0;
}

C++: int main(void){
double a,b,c,d,e,f,i,j,x,y;
while (scanf("%f %f %f %f %f %f",&a,&b,&c,&d,&e,&f) != EOF) {
i=(c*e-f*b)/(a*e-d*b);
j=(c*d-f*a)/(b*d-e*a);
x=i+0.0005;
y=j+0.0005;
printf("%.3f %.3f\n",x,y);
return 0;
}

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

using namespace std;

double x;
double y;

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

}
int main()
{
	double a1,a2,b1,b2,c1,c2;
	int i;
	
	for(;cin >> a1;)
	{
			cin >> b1 >> c1 >> a2 >> b2 >> c2 ;
		
		x=((c1*b2)-(b1*c2))/((a1*b2)-(a2*b1));
		y=((a1*c2)-(a2*c1))/((a1*b2)-(a2*b1));
		
		cout << setprecision(3);
		cout << setiosflags(ios::scientific);
		cout << fixed ;
		serch();
		cout << x << " " << y << endl;
	}
}

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);
	}
	return 0;
}