Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	for scanner.Scan() {
		strNums := strings.Fields(scanner.Text())
		nums := []int{}
		for _, strNum := range strNums {
			num, _ := strconv.Atoi(strNum)
			nums = append(nums, num)
		}
		a := nums[0]
		b := nums[1]
		c := nums[2]
		d := nums[3]
		e := nums[4]
		f := nums[5]
		var mulA, mulD int
		if a < 0 {
			mulA = a * -1
		} else {
			mulA = a
		}
		if d < 0 {
			mulD = d * -1
		} else {
			mulD = d
		}
		a *= mulD
		b *= mulD
		c *= mulD
		d *= mulA
		e *= mulA
		f *= mulA

		if d < 0 {
			d *= -1
			e *= -1
			f *= -1
		}

		bE := b - e
		cF := c - f
		if bE == 0 {
			bE = 1
		}
		y := cF / bE
		x := (c - (y * b)) / a

		fmt.Print(x)
		fmt.Print(".000 ")
		fmt.Print(y)
		fmt.Println(".000")
	}
}

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;
            if (x == 0) {
                x = 0;
            }
            else if (y ==0) {
                y = 0;
            }
        }
        else if (by == ey) {
            ax -= dx;
            x = (c-f) / ax;
            y = (f + dx*(-x)) / ey;
            if (x == 0) {
                x = 0;
            }
            else if (y ==0) {
                y = 0;
            }
        }
        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;
            
            if (x == 0) {
                x = 0;
            }
            else if (y ==0) {
                y = 0;
            }
        }
        
        printf("%.3f %.3f\n", x, y);
        
        
	}
    
    
	return 0;
}

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

C++: #include <iostream>
#include <iomanip>
#include <sstream>
#include <stdio.h>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <math.h>
#include <utility>
#include <string>
#include <ctype.h>
#include <cstring>
#include <cstdio>
#include <sstream>
using namespace std;

#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define INF 114514810
#define ll long long

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

C++: //http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0004
#include <iostream>
#include <iomanip>
using namespace std;
int main() {
	cin.tie(0); ios::sync_with_stdio(false);
	double a, b, c, d, e, f;
	while (cin >> a >> b >> c >> d >> e >> f) {
		a *= e / b; c *= e / b;
		double x = (c - f) / (a - d);
		cout << fixed << setprecision(3) << x << " ";
		double y = (f - d*x) / e;
		cout << fixed << setprecision(3) << y << endl;
	}

}

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

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

using namespace std;

typedef struct {
        double x1;
        double x2;
} answer;

answer solve_simultaneous_equations(double a, double b, double c, double d, double e, double f) {
        answer ans;
        ans.x1 = (c*e - b*f) / (a*e - b*d);
        ans.x2 = (c*d - a*f) / (b*d - a*e);
        return ans;
}

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

        while(cin >> a >> b >> c >> d >> e >> f) {
                answer ans;
                ans = solve_simultaneous_equations(a,b,c,d,e,f);
                cout << showpoint << fixed << setprecision(3) << ans.x1;
                cout << " ";
                cout << showpoint << fixed << setprecision(3) << ans.x2;
                cout << endl;
        }

        return 0;
}

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


using namespace std;


double solveY(int a,int b,int c,int d,int e,int f){
	double ret;
	ret=(double)(a*f-d*c)/(a*e-b*d);
	return ret;
}

int main(){
	while(1){
		int a,b,c,d,e,f;
		if( !(cin>>a>>b>>c>>d>>e>>f) )break;
		double y=solveY(a,b,c,d,e,f);
		double x=(c-b*y)/a;
		printf("%5.3lf %5.3lf",x,y);
	}
	return 0;
}

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

/*
 * Wrong Answer
 * 2015-06-26 02:00
 */

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

	while( std::cin >> a >> b >> c >> d >> e >> f ){
		y = ( a * f - c * d ) / ( a * e - b * d );
		x = ( c - b * y ) / a;
		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)
		{
           	if(a*e-b*d!=0)
         	{
		       y=(a*f-c*d)/(a*e-b*d);
		       x=(c*e-b*f)/(a*e-b*d);
		       cout<<fixed<<setprecision(3)<<x<<" "<<y<<endl;
			}
	    }
	return 0;
}

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

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

typedef struct {
    double x;
    double y;
} xy;

int main()
{
    using namespace std;
    double a, b, c, d, e, f, x, y;
    vector<xy> results;
    
    cout.precision(3);
    cout << fixed << showpoint;
    while (cin >> a >> b >> c >> d >> e >> f) {
        double coef = d/a;
        b *= coef; c *= coef;
        y = (c - f)/(b - e);
        x = (f - e*y)/d;
        x = round(x*1000.0)/1000.0;
        y = round(y*1000.0)/1000.0;
        if (x == 0) x = fabs(x);
        if (y == 0) y = fabs(y);
        results.push_back( {x,y} );
        // cout << x << " " << y << endl;
    }
    for (vector<xy>::iterator itr = results.begin();
         itr != results.end(); ++itr) {
        // xy& tmp = *itr;
        cout << itr->x << " " << itr->y << endl;
    }
}