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<iostream>
#include <fstream>
#include <stdio.h>
#include <stdlib.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<queue>
#include<sstream>
#include<algorithm>
#include<map>
#include<complex>
using namespace std;


#define li			long long int
#define rep(i,to)	for(int i=0;i<((int)(to));i++)
#define repp(i,start,to)	for(int i=(int)(start);i<((int)(to));i++)
#define pb			push_back
#define sz(v)		((li)(v).size())
#define bgn(v)		((v).begin())
#define eend(v)		((v).end())
#define allof(v)	(v).begin(), (v).end()
#define dodp(v,n)		memset(v,(li)n,sizeof(v))
#define bit(n)		(1ll<<(li)(n))
#define mp(a,b)		make_pair(a,b)
#define rin	rep(i,n)
#define EPS 1e-10
#define ETOL 1e-8
#define MOD 1000000007
#define p2(a,b)		cout<<a<<"\t"<<b<<endl
#define p3(a,b,c)		cout<<a<<"\t"<<b<<"\t"<<c<<endl

double a[6];

void solve(){
	double aa=(a[2]*a[4]-a[1]*a[5])/(a[0]*a[4]-a[1]*a[3]);
	double bb=(a[0]*a[5]-a[2]*a[3])/(a[0]*a[4]-a[1]*a[3]);
	if(abs(aa)<EPS)aa=0;
	if(abs(bb)<EPS)bb=0;
	printf("%.3f %.3f\n",aa,bb);
}

int main(){
	while(cin>>a[0]){
		rep(i,5)cin>>a[i+1];
		solve();
	}
	
	return 0;
}

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

void solve()
{
	int a;
	while(cin >> a)
	{
		int b, c, d, e, f;
		cin >> b >> c >> d >> e >> f;
		printf("%.6f %.6f\n", (c * e - b * f) / (double)(a * e - b * d), (c * d - a * f) / (double)(b * d - a * e));
	}
}

int main()
{
	solve();
	return(0);
}

C++: #include<iostream>
#include<iomanip>
#include<vector>
#include<map>
#include<string>
using namespace std;
/*
??£???????¨????
	ax + by = c
	dx + ey = f
????§£x, y???????????????????????°??????
*/
int main() {
	double a, b, c, d, e, f;
	int cnt = 0;						//??\??????????????£???????¨????????????°
	std::vector<double> x_vector;		//x????§£???????´?
	std::vector<double> y_vector;		//y????§£???????´?

#if 0
	while (cnt < 2) {
		cin >> a >> b >> c >> d >> e >> f;
#else
	while (cin >> a >> b >> c >> d >> e >> f) {
#endif
		double x = (b * f - c * e) / (b * d - a * e);
		double y = (c * d - a * f) / (b * d - a * e);

		cnt++;
		x_vector.push_back(x);
		y_vector.push_back(y);
	}

	for (unsigned int i = 0; i < cnt; i++) {
		int dummy_x = x_vector[i] * 1000;
		int dummy_y = y_vector[i] * 1000;

		//x?????????????°???°????¬¬4???????????¨?????\
		if (5 <= (x_vector[i] * 10000 - dummy_x * 10)) {
			x_vector[i] += 0.001;
		}

		//y?????????????°???°????¬¬4???????????¨?????\
		if (5 <= (y_vector[i] * 10000 - dummy_y * 10)) {
			y_vector[i] += 0.001;
		}

		std::cout << std::fixed;
		std::cout << std::setprecision(3) << x_vector[i] << " ";
		std::cout << std::setprecision(3) << y_vector[i] << endl;
		//???????????°
		//std::cout << std::setprecision(3) << x_vector[i] * 10000 << " ";
		//std::cout << std::setprecision(3) << y_vector[i] * 10000 << endl;
		//end???????????°
	}

	//???????????°
	//while (1);

	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  double a,b,c,d,e,f,a2,b2,c2,ansx,ansy; // ax+by=c  dx+ey=f
  while(cin >> a >> b >> c >> d >> e >> f){
    a2=a;
    b2=b;
    c2=c;

    a/=b; // (a/b)x+y=c
    c/=b; // (a/b)x+y=(c/b)
    a*=(-1); // y=(c/b)-(a/b)x
    c*=e; // dx+e(c)=f
    a*=e; // dx+e(c+ax)=f
    a+=d; // dx+(a*e)x+(c*e)=f
    f-=c; // dx+(a*e)x=f-(c*e)
    ansx=f/a;
    if(ansx > -0.0005 && ansx <= 0){
      printf("0.000 ");
    } else{
      printf("%.3f ",ansx);
    }
 
    a2*=ansx;
    c2-=a2;
    ansy=c2/b2;
    if(ansy >= -0.0005 && ansy <= 0){
      printf("0.000\n");
    } else{
      printf("%.3f\n",ansy);
    }
  }
  return 0;
}

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

int main(){
	double a,b,c,d,e,f;
	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;
		if(d != 0){
			e -= b*d;
			f -= c*d;
			d = 0;
		}
		f /= e;
		e = 1;
		c -= b*f;
		b = 0;
		printf("%.3f %.3f\n",c,f);
	}
}

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

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

/*
ax + by = c
dx + ey = f
*/

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

}

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


int main() {
	ios::sync_with_stdio(false);
	double a, b, c, d, e, f;
	
	cin >> a >> b >> c >> d >> e >> f;
	double x = (e*c-b*f)/(a*e-b*d);
	double y = (-c*d+a*f)/(a*e-b*d);
	cout << fixed << setprecision(3) << x << " " << y;
	
	while(cin >> a >> b >> c >> d >> e >> f){
		cout << "\n";
		double x = (e*c-b*f)/(a*e-b*d);
		double y = (-c*d+a*f)/(a*e-b*d);
                if(x==0) x=0;
                if(y==0) y=0;
		cout << fixed << setprecision(3) << x << " " << y;
	}

}

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

    double a,b,c,d,e,f,x,y;
    
    scanf("%d%d%d%d%d%d",&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("%.3f%.3f",x,y);
	
        
	return 0;
}

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

int main(){
	float x, y;
	int a, b, c, d, e, f, p[4], q[4];
	while (true){
		cin >> a >> b >> c >> d >> e >> f;
		if (cin.eof()){
			break;
		}
		if (a == 0){
			y = c / b;
			x = (f - e * y) / d;
		}
		else if (b == 0){
			x = c / a;
			y = (f - d * x) / e;
		}
		else if(d == 0){
			y = f / e;
			x = (c - b * y) / a;
		}
		else if(e==0){
			x = f / d;
			y = (c - a * x) / b;
		}
		else{
			x = (c*e - b*f) / (e*a - b*d);
			y = (c - a*x) / b;
		}
		p[0] = x / 1;
		q[0] = y / 1;
		b = x * 10;
		c = y * 10;
		for (int i = 1;i<4;i++){
			p[i] = (b*10) % 10;
			q[i] = (c*10) % 10;
			x = x * 10;
			y = y * 10;
			b = x;
			c = y;
		}
		cout << p[0] << "." << p[1] << p[2] << p[3] << " " << q[0] << "." << q[1] << q[2] << q[3] << endl;
	}
	return 0;
}

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

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