Go: package main

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

func gcd(num1, num2 int) int {
	if num2 == 0 {
		return num1
	}
	num3 := num1 % num2
	return gcd(num2, num3)
}

func lcm(num1, num2 int) int {
	if num1%num2 != 0 {
		num3 := gcd(num1, num2)
		for i := 1; ; i++ {
			check := num3 * i
			if check%num1 == 0 && check%num2 == 0 {
				return check
			}
		}
	} else {
		return num1
	}
}

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]
		lcm := lcm(a, d)
		mulA := lcm / a
		mulD := lcm / d
		a *= mulA
		b *= mulA
		c *= mulA
		d *= mulD
		e *= mulD
		f *= mulD

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

		bE := b - e
		cF := c - f
		y := float64(cF) / float64(bE)
		x := (float64(c) - (y * float64(b))) / float64(a)

		if x == 0 {
			fmt.Printf("%.3f ", 0.0)
		} else {
			fmt.Printf("%.3f ", x)
		}
		if y == 0 {
			fmt.Printf("%.3f\n", 0.0)
		} else {
			fmt.Printf("%.3f\n", y)
		}
	}
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define MOD 1000000007 //10^9+7
#define INF 1000000000 //10^9

double round3(double x);
pair<double, double>equ2(int a,int b,int c,int d,int e,int f);

pair<double, double>equ2(int a,int b,int c,int d,int e,int f){
    double det=1.0/(a*e-b*d);
    double x=(double)(c*e-b*f)*det;
    double y=(double)(a*f-c*d)*det;
    if (x==-0) x=0;if (y==-0) y=0;
    return pair<double, double>(round3(x),round3(y));
}

double round3(double x){
    if(x>=0) return floor((x+0.0005)*1000)/1000.0;
    return -1*floor((-1*x+0.0005)*1000)/1000.0;
}

int main ()
{
    string str;
    while (!cin.fail()) {
        int a,b,c,d,e,f;
        
        cin>>a>>b>>c>>d>>e>>f;
        
        pair<double,double> ans=equ2(a,b,c,d,e,f);
        
        printf("%.3f %.3f\n",ans.first,ans.second);
    }
    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 * (( a * f - c * d ) / ( a * e - b * d ))) / a;
		printf("%.3f %.3f\n", x, y );
	}

	return 0;
}

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

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

C++: 
int main() {
	std::cout << std::setprecision(3);
	std::cout.setf(std::ios::fixed, std::ios::floatfield);
	double a, b, c, d, e, f;
	while( std::cin >> a >> b >> c >> d >> e >> f ) {
		const double x = (b*f-c*e) / (b*d-a*e);
		const double y = (c-a*x) / b;
		std::cout << ((-0.0005<=x && x<0.0005)?0.0:x) << " " << ((-0.0005<=y && y<0.0005)?0.0:y) << std::endl; 
	}
}

C++: #include<stdio.h>

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

C++: #include <algorithm>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <cctype>
#include <iostream>
#include <set>
#include <string>
#include <queue>
#include <map>
using namespace std;
int size(string x){
	string::size_type size=x.size();
	return size;
}
#define fu(l,k) for(int i=l;i<k;i++)
#define fd(l,k) for(int i=l;i>k;i--)
#define fi first
#define se second
typedef  vector<string> vs;
typedef  vector<int> vi;
double pi(){
	return M_PI;
}
typedef set<int> set_i;
typedef set<string> set_s;
int main(){
	int a,b,c,d,e,f,a1;
	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 * (f * a - c * d);
		if(x==-0.0) x=0.0;
		if(y==-0.0) y=0.0;
		printf("%.3lf %.3lf\n",x,y);
	}
}

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

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

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

	return 0;
}

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

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

C++: #include <cstdio>

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 D = a*e-b*d;
        double x = (e*c-b*f)/D;
        double y = (a*f-c*d)/D;
        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){
    float a,b,c,d,s,t;
    while(~scanf("%f%f%f%f%f%f",&a,&b,&s,&c,&d,&t)){
        printf("%.3f %.3f\n",(s*d-b*t)/(a*d-b*c),(a*t-s*c)/(a*d-b*c));
    }
    return 0;
}

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

int main() {
	// your code goes here

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

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

    double y = (a*f-c*d)/(a*e-d*b);
    if(y == 0.0){
      y = 0;
    }

    double x = (c-b*y)/a;
    if(x == 0){
      x = 0;
    }

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

  }
	return 0;
}

C++: #include<stdio.h>
int main(void){
	double a,b,c,d,e,f;
	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){
		B=b*d;
		C=c*d;
		E=a*e;
		F=a*f;
		y=(C-F)/(B-E);
		A=a*e;
		C=c*e;
		D=b*d;
		F=b*f;
		x=(C-F)/(A-D);
		printf("%1.3lf %1.3lf\n",x,y);
	}
	return 0;
}

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

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

  return 0;
}

C++: #include <iostream>
#include <vector>
#include <fstream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <ctime>
#include <iterator>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
using namespace std;


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