Go: package main

import "fmt"

func main() {
	var Xs, Ys []float32
	Xs = make([]float32, 0)
	Ys = make([]float32, 0)
	var cnt int
	for {
		var a, b, c, d, e, f, x, y float32
		fmt.Scanf("%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f)
		if a == 0 {
			break
		}
		y = (((a * f) - (d * c)) / ((a * e) - (b * d)))
		x = ((c - (b * y)) / a)
		Xs = append(Xs, x)
		Ys = append(Ys, y)
		cnt++
	}
	for i := 0; i < cnt; i++ {
		fmt.Printf("%.3f %.3f\n", Xs[i], Ys[i])
	}
}

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

using namespace std;

/* ax + by = c
   dx + ey = f
   
   (x, y) = { (ce - bf) / (ae - bd), (af - cd) / (ae - bd) } */


void Equation2(double a, double b, double c, double d, double e, double f, double& x, double& y)
{
	x = (c * e - b * f) / (a * e - b * d);
	y = (a * f - c * d) / (a * e - b * d);
}

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

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

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

	return 0;
}

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




double gcd( double m, double n )
{
	// 引数に０がある場合は０を返す
	if ( ( 0 == m ) || ( 0 == n ) )
		return 0;
	
	// ユークリッドの方法
	while( m != n )
	{
		if ( m > n ) m = m - n;
		else         n = n - m;
	}
	return m;
}

double lcm( double m, double n )
{
	// 引数に０がある場合は０を返す
	if ( ( 0 == m ) || ( 0 == n ) )
		return 0;
	
	return ((m / gcd(m, n)) * n); // lcm = m * n / gcd(m,n)
}


int main(){
    
	double ax, by, c, dx, ey, f;
    double x, y;
    double l, d1, d2;
        
	while(cin>> ax>> by>> c >> dx>> ey>> f){
        
        x = 0.0;
        y = 0.0;
        
        if(ax == dx){
            by -= ey;
            y = (c-f) / by;
            x = (f + ey*(-y)) / dx;
        }
        else if (by == ey) {
            ax -= dx;
            x = (c-f) / ax;
            y = (f + dx*(-x)) / ey;
        }
        else{
            l = lcm(fabs(ax), fabs(dx));
            d1 = fabs(l / ax);
            d2 = fabs(l / dx);
            ax *= d1;
            by *= d1;
            c  *= d1;
            dx *= d2;
            ey *= d2;
            f  *= d2;
            
            by -= ey;
            y = (c-f) / by;
            x = (f + ey*(-y)) / dx;
        }
        
        printf("%.3f %.3f\n", x, y);
        
        
	}
    
    
	return 0;
}

C++: #include<iostream>
#include <iomanip>
using namespace std;
int main()
{
	double a,b,c,d,e,f,x,y;
	while(cin>>a>>b>>c>>d>>e>>f,!cin.eof())
	{
		
		y = b/e;
		x = (y*f-c)/(y*d-a);
		y = (c-a*x)/b;
		cout<<setiosflags(ios::fixed)<<setprecision(3);
		cout<<x<<" "<<y<<endl;
	}
	return 0;
}

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


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

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

#define MAX_N 100
#define MAX_set 200

typedef long long int ll;
using namespace std;


int main(){

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

	while(scanf("%lf%lf%lf%lf%lf%lf", &a, &b, &c, &d, &e, &f) != EOF){

		double x = (e*c-b*f)/(e*a-b*d);
		if(e*c == b*f)
			x = 0;
	
		printf("%.3f %.3f\n", x, (c-a*x)/b);
	
	
	
	}

}

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

int main(void) {
    int a, b, c, d, e, f;
    float x, y;
    float det;
    while(cin >> a >> b >> c >> d >> e >> f) {
        det = a * e - b * d;
        x = (float)(e * c - b * f) / det;
        y = (float)(-d * c + a * f) / det;
        x = roundf(1000 * x) / 1000.0;
        y = roundf(1000 * y) / 1000.0;
        if(x == -0)
            x = 0.0;
        if(y == -0)
            y = 0.0;
        printf("%.3f %.3f\n", x, y);
    }
}

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

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

C++: #include <stdio.h>
#include <iostream>
#include <math.h>
#define eps 1e-9
using namespace std;
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)
    {
        x=(b*f-e*c)/(b*d-e*a);
        y=(c-a*x)/b;
        printf("%.3lf %.3lf\n",x+eps,y+eps);
    }
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;

#define pb push_back
#define rep(i, n) for(int i = 0; i < (n); i++)
#define dep(i, a, n) for(int i = a; i >= (n); i--)
#define FOR(i, a, n) for(int i = a; i < (n); i++)
#define mod (ll)(1e9+7)
#define int ll
#define INF 100000000

__attribute__((constructor))
void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}

signed main() {
	double a, b, c, d, e, f, x, y;
  while(cin >> a >> b >> c >> d >> e >> f) {
    x = (c * e - b * f) / (a * e - b * d) + 0.0000;
    y = (c * d - a * f) / (b * d - a * e) + 0.0000;
    cout << fixed << setprecision(3) << x << " " << y << 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>>b>>c>>d>>e>>f){
    double y=(a*f-c*d)/(a*e-b*d);
    double x=(c-b*x)/a;
    printf("%.3f %.3f\n",x,y);
  }
  

}

C++: // includes
#include <cstdio>
#include <cstdint>
#include <iostream>
#include <iomanip>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <utility>
#include <functional>
#include <cmath>
#include <climits>
#include <bitset>

// macros
#define ll long long int
#define pb push_back
#define mk make_pair
#define pq priority_queue
#define FOR(i, a, b) for(int i=(a); i<(b);++i)
#define rep(i, n) FOR(i, 0, n)

using namespace std;

//  types
typedef pair<int, int> P;
typedef pair<ll, int> Pl;
typedef pair<ll, ll> Pll;
 
// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double EPS = 1e-10;

// solve

int main(int argc, char const* argv[])
{
  double a, b, c, d, e, f;
  while(cin >> a){
    cin >> b >> c >> d >> e >> f;
    double det = a * e - b * d;
    cout << (e * c - b * f) / det;
    cout << " ";
    cout << (- d * c + a * f) / det << endl;
  }
	return 0;
}

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

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

C++: #include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#define shosu(x) fixed<<setprecision(x)
using namespace std;
int main(){
	cout<<shosu(3);
	double a,b,c,d,e,f;
	while(cin>>a>>b>>c>>d>>e>>f){
		double tmp=a*e-b*d;
		double ansx=(c*e-b*f)/tmp;
		double ansy=(a*f-c*d)/tmp;
		if(ansx==-0) ansx=0;
		if(ansy==-0) ansy=0;
		cout<<ansx<<' '<<ansy<<endl;
	}
}

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

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