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("%04f %04f\n", x, y)
        }
}

C++: #include <stdio.h>

int main() {
	
	double a, b, c, d, e, f;	//scanf
	double x, y;							//ans
	int t, t2;
	
	double n = 0, m = 0, j = 0, h = 0, i = 0;						//temp
	
	while(1){
		
		if (scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) == EOF) break;
		
		//printf("%lf %lf %lf\n%lf %lf %lf\n", a, b, c, d, e, f);	//input
		
		n = a / d;                                             //Xツづーツ堕オツつヲツつスツつ「
		j = d * n; h = e * n; i = f * n;
		
		//printf("%lf %lf %lf\n%lf %lf %lf\t\t%lf\n", a, b, c, j, h, i, n);
		
		m = b - h;
		y = c - i;
		//printf("%lf %lf\n", m, y);
		
		if(y != 0) y /= m;
		//printf("%lf\n", y);
		
		i = c - (b * y);
		x = i / a;
		
		//printf("x = %lf, y = %lf\n", x, y);
		
		x += 0.0005;
		y += 0.0005;
		
		x *= 1000;
		y *= 1000;
		t = (int)x;
		t2 = (int)y;
		x = t;
		y = t2;
		
		x /= 1000;
		y /= 1000;
		
		printf("%.4lf %.4lf\n", x, y);
		
	}
	return 0;
}

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

C++: #include<iostream>
#include<iomanip>
#include<cmath>
using namespace std;
#define EPS (1.0e-3)

int main(){
	double a,b,c,d,e,f;
	double x,y;
	while(cin>>a>>b>>c>>d>>e>>f){
		b=d*b-a*e;
		c=d*c-a*f;
		y=c/b;if(abs(y)<EPS) y=0;
		x=(f-e*y)/d;if(abs(x)<EPS) x=0;
		cout<<setprecision(3)<<setiosflags(ios::fixed)<<x<<" "<<y<<endl;
	}
	return 0;
}

C++: #include<iostream>
#include<iomanip>
#include<cmath>
using namespace std;
#define EPS (5.0e-4)

double t;
double a,b,c,d,e,f;

void swap(double *a,double *b){
	double t=*a;
	*a=*b;
	*b=t;
}

int main(){
	cout<<setprecision(3)<<setiosflags(ios::fixed);
	while(cin>>a>>b>>c>>d>>e>>f){
		if(a==0){
			swap(a,d);
			swap(b,e);
			swap(c,f);
		}
		b/=a; c/=a; a=1;
		e-=d*b; f-=d*c; d=0;
		f/=e; e=1;
		c-=f*b; b=0;
		if(abs(c)<EPS) c=0;
		if(abs(f)<EPS) f=0;
		cout<<c<<" "<<f<<endl;
	}
	return 0;
}

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

using namespace std;

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

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

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)){
		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("%.3ld %.3ld",x,y);
	}
	return 0;
}

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

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

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

#include <math.h>
using namespace std;

int main()
{
	double A, B, C, D, E, F, X, Y, G , H;

	while(cin >> A >> B >> C >> D >> E >> F)
	{
		G = A / D;
		D *= G;
		E *= G;
		F *= G;
		Y = (F-C) / (E-B);
		
		D /= G;
		E /= G;
		F /= G;
		H = B / E;
		D *= H;
		E *= H;
		F *= H;
		X = (F-C) / (D-A);

		printf("%.3f %.3f\n",X,Y);
	}

	return 0;
}

C++: #include<iostream>


using namespace std;

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

		x=(e*c-f*b)/(e*a-b*d);
		y=(d*c-f*a)/(b*d-a*e);
		x*=1000;
		x+=0.5;
		x=(long)x;
		x/=1000;

		y*=1000;
		y+=0.5;
		y=(long)y;
		y/=1000;

		cout<<x<<" "<<y<<endl;

		x=y=a=b=c=d=e=f=0;
	}
}

C++: #include <iostream>
#include <cstdio>
#include <limits>
#define eps 1e-10
using namespace std;

int main(void) {
    double a, b, c, d, e, f;
    //double inf = numeric_limits<double>::infinity();
    while(scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF) {
        double ya = d * c - a * f;
        double yb = b * d - a * e;
        if(yb == 0) yb += eps;
        double y = ((ya) / (yb));
        //if(yb == 0) y = inf;
        if(a == 0) a += eps;
        double x = ((c - b * y) / a);
        //if(a == 0) x = inf;
        printf("%.3f %.3f\n",x, y);
    }
    
    return(0);
}

C++: #include <iostream>
#include <math.h>
#include <cstdio>

using namespace std;

double a, b, c, d, e, f;
double tmp_x, tmp_y, tmp;

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

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

int main(){

    double a, b, c, d, e, f;
    while (cin >> a >> b >> c >> d >> e >> f){
        double x = (e*c - b*f) / (e*a - d*b);
        double y = (a*f - d*c) / (e*a - d*b);
        cout << fixed << setprecision(3) << x << " " << y;
    }

    return 0;
}

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

using namespace std;

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

	while(cin>>a>>b>>c>>d>>e>>f){	
			double x,y;

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

			double diff = 0.5;

			x<0?(diff=-0.5):(diff=0.5);
			x = (int)(x*1000+diff);
			
			y<0?(diff=-0.5):(diff=0.5); 
			y = (int)(y*1000+diff); 
			

			x /= 1000;y/=1000;
			

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

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

int main()
{
	double a,b,c,d,e,f;
	cout.precision(4);
	while (cin >> a && cin >> b && cin >> c && cin >> d && cin >> e && cin >> f){
		cout << (f/e - c/b) / (d/e - a/b) << endl;
		cout << (f/d - c/a) / (e/d - b/a) << endl;
	}
	return 0;
}

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

int main(){
	double a,b,c,d,e,f;
	while(cin>>a>>b>>c>>d>>e>>f){
		double det = a*e-b*d;
		double x = 1/det*(c*e - b*f);
		double y = 1/det*(-c*d + a*f);	
		x = round(1000*x) / 1000;
        y = round(1000*y) / 1000;
        if(x==0)x=0;
        if(y==0)y=0;

		cout << fixed << setprecision(3) << x << ' ' << y <<endl;
	}
	return 0;
}

C++: #include<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<vector>
#include<functional>
#include<algorithm>
#include<cstdio>
using namespace std;
int main() {
	long double a, b, c, d, e, f;
	while (cin >> a >> b >> c >> d >> e >> f) {
		c *= (d / a);
		b *= (d / a);
		a *= (d / a);
		long double ansx=0, ansy=0;
		if (f - c != 0) {
			ansy = (f - c) / (e - b);
		}
		if (a != 0) {
			ansx = (c - ansy*b) / a;
		}
		ansx *= 1000;
		ansx = round(ansx);
		ansx /= 1000;
		ansy *= 1000;
		ansy = round(ansy);
		ansy /= 1000;
		if (ansx == 0) ansx = 0;
		if (ansy == 0) ansy = 0;
		printf("%.3LF %.3LF\n", ansx, ansy);
	}
}

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 ){
		x = (c*e - b*f)/(a*e - b*d);
		y = (c*d - a*f)/(b*d - a*e);

		if(x==0) x=0;
		if(y==0) y=0;

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