Go: package main

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

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
                fmt.Printf("%.3f %.3f\n", x, y)
        }
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
#include <iterator>
#include <cmath>
#include <stack>
#include <functional>
#include <iomanip>
using namespace std;

int main()
{
  double a,b,c,d,e,f;
  while(cin >> a >> b >> c >> d >> e >> f, !cin.eof()) {
    double x,y;
    x = 1/(a*e-b*d)*(e*c-b*f);
    y = 1/(a*e-b*d)*((-d)*c+a*f);
    cout << fixed << setprecision(3) << x << ' ' <<   y << endl;
  }

  return 0;
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
double Emat(int a,int b,int c,int d);

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

double Emat(int a,int b,int c,int d){
	return a*d-b*c;
}

C++: #include <stdio.h>
int main(){
	double a,b,c,d,e,f,x,y;
	while(scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f)!=EOF){
		if(a*e!=b*d){
			x = (e*c-b*f)/(a*e-b*d);
			y = (a*f-c*d)/(a*e-b*d);
			x*=1000;y*=1000;
			if(x>0) x+=0.5;
			else x-=0.5;
			if(y>0) y+=0.5;
			else y-=0.5;
			x=(int)x;y=(int)y;
			x/=1000;y/=1000;
			printf("%.3f %.3f\n",x,y);
		}
	}
	return 0;
}

C++: #include<iostream>
#include<iomanip>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<cmath>
#include<queue>
#include<stack>
#include<functional>
#include<string>
#include<cstring>
#include <sstream>
using namespace std;
int main(void){
    double a,b,c,d,e,f,x,y;
    while(cin >> a >> b >> c >> d >> e >> f){
        double ad = a / d;
        d *= ad;
        e *= ad;
        f *= ad;
        d -= a;
        e -= b;
        f -= c;
        y = f/e;
        x = (c - b * y)/a;
        y *= 1000;
        y = round(y);
        y /= 1000;
        x *= 1000;
        x = round(x);
        x /= 1000;
        cout << fixed << setprecision(3) << x << " " << y << endl;
    }
    return 0;
}

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

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

	while(cin >> a >> b >> c >> d >> e){
		float x, y;
		x = (float)(b*f - c*e)/(b*d -a*e);
		y = (float)(c - a*x)/b;
		cout << x << " " << y << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int main(){
double a,b,c,d,e,f;
double x,y;
while(scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f)!=EOF){
    x=(e*c-b*f)/(a*e-d*b);
    y=(f*a-c*d)/(a*e-d*b);
    printf("%.3lf %.3lf\n",x,y);

}
printf("\n");
return 0;
}

C++: #include<iostream>
#include<math.h>
#include<cstdio>
using namespace std;
int main(){
	while(1){
		int a,b,c,d,e,f;
		cin>>a>>b>>c>>d>>e>>f;
		if(cin.eof()) {break;}
		double d1,d2,d3;
		d1=a*e-b*d;
		d2=c*e-b*f;
		d3=a*f-c*d;
                double x=d2/d1,y=d3/d1;
		if(x<0&&y<0)
		    printf("-%.3f -%.3f\n",fabs(x),fabs(y));
                if(x<0&&y>=0)
		    printf("-%.3f %.3f\n",fabs(x),fabs(y));
		if (x>=0&&y<0)
		    printf("%.3f -%.3f\n",fabs(x),fabs(y));
		if (x>=0&&y>=0)
		    printf("%.3f %.3f\n",fabs(x),fabs(y));
	}
	return 0;	
}

C++: #include <iostream>
#include <cstdio>
using namespace std;
void calc(double x1, double y1, double a, double x2, double y2, double b)
{
	double d1 = x2;
	double d2 = x1;
	double xx1 = d1 * x1;
	double xy1 = d1 * y1;
	double a1 = d1 * a;
	double xx2 = d2 * x2;
	double xy2 = d2 * y2;
	double b1 = d2 * b;
	double y = xy1 - xy2;
	double c = a1 - b1;
	y = c / y;


	d1 = y2;
	d2 = y1;
	xx1 = d1 * x1;
	xy1 = d1 * y1;
	a1 = d1 * a;
	xx2 = d2 * x2;
	xy2 = d2 * y2;
	b1 = d2 * b;
	double x = xx1 - xx2;
	c = a1 - b1;
	x = c / x;
	if (x == 0)
	{
		x = 0;
	}
	if (y == 0)
	{
		y = 0;
	}
	printf("%.3lf %.3lf\n", x, y);
}
int main()
{
	int x1, y1, a, x2, y2, b;

	while(scanf_s("%d %d %d %d %d %d", &x1, &y1, &a, &x2, &y2, &b) != EOF)
	{
		calc(x1, y1, a, x2, y2, b);
	}

		
	return 0;
}

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

int main()
{
	int a[6];
	double x, y;
	for (int i = 0; i < 6; ++i)
		std::cin >> a[i];

	y = (double)(a[0] * a[5] - a[2] * a[3]) / (double)(a[0] * a[4] - a[1] * a[3]);
	x = (double)(a[5] - a[4] * y) / (double)a[3];

	std::cout << std::fixed << std::setprecision(4) << x << " " << y << std::endl;

	return 0;
}

C++: #include<iostream>
#include<stdio.h>
using namespace std;
int main()
{
    float a,b,c,d,e,f,i,j;
    while(cin>>a>>b>>c>>d>>e>>f)
    {
        i=(c*e-b*f)/(a*e-b*d);
        j=(a*f-c*d)/(a*e-b*d);
        printf("%.3f %.3f",i,j);
    }

    return 0;
}

C++: #include<stdio.h>
#include<iostream>
#include<cmath>
#define EPS 0.001
 
using namespace std;
 
main(){
  int a, b, c, d, e, f;
  double x, y;
  while ( cin >> a >> b >> c >> d >> e >> f ){
    x = 1.0 * ( c*e - b*f ) / ( a*e - b*d ) + EPS;
    y = 1.0 * ( c*d - a*f ) / ( b*d - a*e ) + EPS;
    printf("%.3lf %.3lf\n", x, y);
  }
}

C++: #include <stdio.h>

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

	while(scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f) != EOF){
		tmp = a/d;
		b -= e*tmp;
		c -= f*tmp;
		y = c / b;
		f -= e*y;
		x = f / d;
		if((int)(x*1000.0) == 0){
			x = 0.0;
		}else if((int)(y*1000.0) == 0){
			y = 0.0;
		}
		printf("%.3lf %.3lf\n",x,y);
	}

	return 0;
}

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

#define N 1024


double func(double x)
{
	x *= 1000;
	x = (double)(int)(x + 0.5);
	x /= 1000;
	return x;
}

int main()
{
	char buff[N];
	
	while (NULL != fgets(buff, N, stdin))
	{
		double a, b, c, d, e, f;
		sscanf(buff, "%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f);
		
		double dd = a * e - b * d;
		double x = ( e * c - b * f ) / dd;
		double y = ( - d * c + a * f ) / dd;
		
		x = func(x);
		y = func(y);

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


}

C++: #include <cstdio>

int main(){
  double a,b,c,d,e,f;
  while(~scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f))
    printf("%.3f %.3f",(c*e-b*f)/(a*e-b*d),(-c*d+a*f)/(a*e-b*d));
}

C++: #include <cstdio>
#include <iostream>
double sol[10000][2];
int main()
{
    double a, b, e, c, d, f;
    int i = 0;
    while (std::cin >> a >> b >> e >> c >> d >> f)
    {
        double det = a * d - b * c;
 
        double aa = d / det, bb = -b / det, cc = -c / det, dd = a / det;
        sol[i][0] = aa * e + bb * f;
        sol[i][1] = cc * e + dd * f;
 
        i++;
    }
    for (int j = 0; j < i; j++)
        printf("%.3f %.3f\n", sol[j][0], sol[j][1]);
    return 0;

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

  }
  return 0;
}

C++: #include<stdio.h>
int main(){
	double a,b,c,d,e,f,x,y;
	while(scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f)!=-1){
		x=((c*e-f*b)/(a*e-d*b));
		y=((c-a*x)/b);
		if(x>0)x+=0.0005;
		else x-=0.0005;
		if(y>0)x+=0.0005;
		else y=-0.0005;
		printf("%.3lf %.3lf\n",x,y);
	}
	return 0;
}