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>

double sishagonyu(double num)	{
	
	//int num2;
	
	if (num == 0) return num;
	
	if (num > 0) { num += 0.0005; }
	else { num -= 0.0005; }
	
	num = (double)(int)(num * 1000) / 1000;
	
	//	num *= 1000;
	//	num2 = (int)num;
	//	num = num2;
	//	num /= 1000;
	
	return num;
}

int main() {
	
	//printf("%.3lf", sishagonyu((double)-0.0015));
	
	
	double a, b, c, d, e, f;
	double x, y;
	
	double n, m, h, i;
	
	while(scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF){
		
		//if (scanf("%lf %lf %lf %lf %lf %f", &a, &b, &c, &d, &e, &f) == EOF) break;
		
		//printf("input:\n%f %f %f\n%f %f %f\n", a, b, c, d, e, f);	//input
		
		if (a == 0) { y = c / b; }
		if (b == 0) { x = c / a; }
		if (d == 0) { y = f / e; }
		if (e == 0) { x = f / d; }
		
		n = a / d;
		
		//j = d * n;
		h = e * n;
		i = f * n;
		
		//printf("%f %f %f\t%f %f\t%f\n", a, b, c, h, i, n);
		
		m = b - h;
		y = c - i;
		//printf("%f %f\n", m, y);
		
		if(y <= 0.0004 && y >= -0.0005) { 
			
			//printf("y = 0\n");
			y = 0; 
			
		} else {
			
			y /= m;
			//printf("%f\n", y);
			
			i = c - (b * y);
			x = i / a;
			
			//printf("x = %f, y = %f\n", x, y);
			
			x = sishagonyu(x);
			y = sishagonyu(y);
			
		}
		//printf("%f %f\n", x, y);
		printf("%.3f %.3f\n", x, y);
	}
	return 0;
}
//2.2 3.3 22.24706 3.2 8.7 50.12932
//3.2777 4.5564

//1 2 3 4 5 6
//-1.000 2.000

//2 -1 -2 -1 -1 -5
//1.000 4.000

//2 -1 -3 1 -1 -3
//0.000 3.000

// 2 -1 -3 -9 9 27
// 0.000 3.000

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

C++: #include<bits/stdc++.h>
using namespace std;
int main()
{
    double a,b,c,d,e,f,g,h;
    while(cin>>a>>b>>c>>d>>e>>f){
            h=0;g=0;
    h=(d*c-a*f)/(b*d-a*e);
    g=(c-b*h)/a;
    printf("%.3lf %.3lf\n",g,h);
    }
    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);
  }

  return 0;
}

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

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

C++: #include <cstdio>

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

	while (scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF){
		double y = (d * c - a * f) / (d * b - a * e);
		double x = (c - b * y) / a;
		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)!=EOF&&scanf("%lf",&b)!=EOF&&scanf("%lf",&c)!=EOF&&scanf("%lf",&d)!=EOF&&scanf("%lf",&e)!=EOF&&scanf("%lf",&f)!=EOF){

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( void )
{
	while ( !cin.eof() )
	{
		int a, b, c, d, e, f;
		cin >> a >> b >> c >> d >> e >> f;
		if ( cin.eof() )
			break;

		double delta = 1.0 / ( a*e - b*d );

		double x = (double)( e * c - b * f ) * delta;
		double y = (double)( a * f - d * c ) * delta;

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

	}
}

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

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

	while(cin >> a[cnt] >> b[cnt] >> c[cnt] >> d[cnt] >> e[cnt] >> f[cnt]) cnt++;

	for(int i=0; i<cnt; 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];
			}
		}
	}

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

	return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double ESP=1e-10;
using namespace std;
int main(){
  double a,b,c,d,e,f;
  while(cin>>a){
    cin>>b>>c>>d>>e>>f;
    double x=(c*e-b*f)/(a*e-b*d);
    double y=(f-d*x)/e;
    if(x==0)x=0;
    if(y==0)y=0;
    printf("%.5f %.5f\n",x,y);
  }
}

    
    /*
      ey=f-dx
      y=(f-dx)/e
      ax+b(f-dx)/e=c
      aex+df-bdx=ce
      (ae-bd)x=ce-df
      x=(ce-df)/(ae-bd)

  y=(f-dx)/e
  y=(f



a b  x  c
d e  y  f

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

C++: #include <iostream>
#include <algorithm>
#include <string.h>
#include <math.h>
using namespace std;

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

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

using namespace std;

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

C++: #include<cstdio>
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<string>
#include<functional>
#include<queue>
#include<math.h>
#define INF 999999

using namespace std;


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

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

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

	return 0;
}

C++: #include <stdio.h>
float round3(float a){
	a=a*10000;
	if(int(a)%10>5)a=a+10;
	a=float (int (a/10));
	a=a/10000;
	return a;

}
int main(){
	int a,b,c,d,e,f;
	double x,y;
	while((scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f))!=EOF){
		if(a!=0.0){
		  y=(f-c*d/a)/(e-b*d/a);
		  x=(c-b*y)/a;
		}
		else if(d!=0.0 && b!=0.0){
		  y=c/b;
		  x=(f-e*y)/d;
		}
		else if(d==0.0){
		  x=0.0;
		  if(b!=0.0) y=c/b;
		  else if(e!=0.0) y=f/e;
		}

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

C++: #include <stdio.h>
#include <math.h>

int main(){
	float a,b,c,d,e,f;
	float x,y;
	
	while(scanf("%f %f %f %f %f %f",&a,&b,&c,&d,&e,&f) != EOF){
		y = (c/a-f/d)/(b/a-e/d);
		x = c/a-b/a*y;
		printf("%.3f %.3f\n",x,y);
	}
	return 0;
}