Go: package main

import (
	"fmt"
)

func main() {
	for {
		var a, b, c, d, e, f float64
		i, _ := fmt.Scan(&a, &b, &c, &d, &e, &f)
		if i == 0 {
			break
		}

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

		fmt.Printf("%.3f %.3f\n", x, y)
	}
}

C++: #include <iostream>
#include <vector>
#include <algorithm>

#define rep(x,to) for(x=0;x<to;x++)
#define rep2(x,from,to) for(x=from;x<to;x++)

using namespace std;


int main(void){

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

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

int main(){

	float a, b, c, d, e, f;

	while( cin >> a >> b >> c >> d >> e >> f ){

		float det = a * e - b * d;

		float dx = c * e - b * f;
		float dy = a * f - c * d;

		float x = dx / det;
		float y = dy / det;

		if( x == -0.000 )x = 0.000;
		if( y == -0.000 )y = 0.000;

		cout << fixed << setprecision(3) << x << " " << y << endl;
	}

	return 0;
}

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

}
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*e==b*d){
		}else{
			x=(c*e-b*f)/(a*e-b*d);
			y=(c*d-a*f)/(b*d-a*e);
		}
		x=round3(x);
		y=round3(y);
		printf("%0.3lf %0.3lf\n",x,y);
	}
	return 0;
}

C++: #include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;
int main(void){
	long long a, b, c, d, e, f;
	long long p, q, r;
	long long x, y, z;
	for (; scanf("%lld %lld %lld %lld %lld %lld", &a, &b, &c, &d, &e, &f) !=EOF;){
		c = c * 1000;
		f = f * 1000;
		p = (a*e) - (d*b);
		q = (c*e) - (f*b);
		x = q / p;
		p = (b*d) - (e*a);
		q = (c*d) - (f*a);
		y = q / p;
		printf("%lld.%03lld %lld.%03lld\n", x / 1000, x % 1000, y / 1000, y % 1000);
	}

		return 0;
	}

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

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

	scanf("%lf%lf%lf%lf%lf%lf",&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("%.3lf% .3lf",x,y);

	return 0;
}

C++: #include <cstdio>

using namespace std;

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

C++: #include<stdio.h>
int main(void){

	double a, b, c, d, e, f;
	double A,B;
	double x, y;

	while(scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF){
		 
	 
	 if ( (a >= 0 && d <=　0)|| (a >= 0 && d >= 0)) {
		A = c*d - f*a;
		B = b*d - e*a;
        y = A / B;
    }
    
    else if ((a < 0 && d > 0) || (a < 0 && d < 0)) {
		A = c*d + f*a;
		B = b*d + e*a;
        y = A / B;
    }


    x = (c - y * b) / a;
	printf("%.3f %.3f\n" ,x , y);
	}
	return 0;

}

C++: #include<stdio.h>
int main(){

double a,b,c,d,e,f,x,y,dd;
y=0;x=0;
 while(scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF){
dd=e*a-b*d;
if(dd!=0;){
y=(d*c-a*f)/(b*d-a*e);
x=(e*c-b*f)/(e*a-b*d);
x=(x==fabs(x))?fabs(x):x; 
y=(y==fabs(y))?fabs(y):y; 


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

C++: #include <iostream>
#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 - ci) / ( bi * di / ei - ai);
        double y = (ci - ai * x) / bi;
        if(x == -0) x = 0;
        if(y == -0) y = 0;
        cout << x << " " << y << endl;
    }
    return 0;
}

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

float a,b,c,d,e,f;
double    round( double val, int precision )
{
    double    ret;
    char    buf[256] = {'\0'};
    char    *p;

    sprintf( buf, "%.*f", precision, val );
    ret = strtod( buf, &p );

    return ret;
}
int main (){
  scanf("%f %f %f %f %f %f",&a,&b,&c,&d,&e,&f);
  double x,y;
  x=(f*b/e-c)/(d*b/e-a);
  y=(f*a/d-c)/(e*a/d-b);
 round(x,4);
 round(y,4);
modf(x*1000, &x);
modf(y*1000, &y);
  printf("%.3f %.3f",x/1000,y/1000);
}

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

int main(){
  for(double a1,b1,c1,d1,e1,f1,b2,c2,e2,f2,a3,c3,d3,f3,x,y;cin>>a1>>b1>>c1>>d1>>e1>>f1;){

    b2=b1*d1;
    c2=c1*d1;

    e2=a1*e1;
    f2=a1*f1;

    y=(c2-f2)/(b2-e2);
    if(y==-0.000){
      y=0.000;
    }

    a3=a1*e1;
    c3=c1*e1;

    d3=b1*d1;
    f3=b1*f1;

    x=(c3-f3)/(a3-d3);
    if(x==-0.000){
      x=0.000;
    }

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

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

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

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

	int det;

	
	while (cin >> a >> b >> c >> d >> e >> f){

		det = deter(a, b, d, e);

		printf("%.3lf ", deter(c, b, f, e) / det);
		printf("%.3lf\n", deter(a, c, d, f) / det);



		
	}

	//system("pause");
	return 0;
}

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

struct hoge{
	double a[2],b[2],c[2];
};

void coll(double a,double b,double c,double a2,double b2,double c2){
	double x, y;
	x = (c * b2 - b * c2) / (a * b2 - b * a2);
	y = (c2 * a - c * a2) / (a * b2 - a2 * b);
	if(x == 0){
		x = 0.000;
	}
	if(y == 0){
		y = 0.000;
	}

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

int main()
{
	hoge date;

	while(cin >> date.a[0] >> date.b[0] >> date.c[0] >> 
		date.a[1] >> date.b[1] >> date.c[1])
	{
		coll(date.a[0], date.b[0], date.c[0], date.a[1], date.b[1], date.c[1]);
	}
	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 - ci) / ( bi * di / ei - 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<iostream>
#include<iomanip>
using namespace std;

int main(){
	double a11,a12,c,a21,a22,f;
	while(cin>>a11>>a12>>c>>a21>>a22>>f){
		double x,y,delta=((double)a11*a22-(double)a12*a21);
		x=((double)a22*c-(double)a12*f)/delta;
		y=((double)a11*f-(double)c*a21)/delta;
		if(x>0){x=(double)(((int)((x*1000)+0.5))/1000);
		}else{x=(double)(((int)((x*1000)-0.5))/1000);}
		if(y>0){y=(double)(((int)((y*1000)+0.5))/1000);
		}else{y=(double)(((int)((y*1000)-0.5))/1000);}
		cout<<fixed<<setprecision(3)<<x<<" "<<y<<endl;
	}
	return 0;
}