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 <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
double gcd( double m, double n );
double lcm( double m, double n );
int main(int argc, const char * argv[])
{
    double a=0.0;
    double b=0.0;
    double c=0.0;
    double d=0.0;
    double e=0.0;
    double f=0.0;
    double x=0.0;
    double y=0.0;
    int end=0;
    
    while(scanf("%d",&end)!=EOF){
        a=end;
        scanf("%lf",&b);
        scanf("%lf",&c);
        scanf("%lf",&d);
        scanf("%lf",&e);
        scanf("%lf",&f);
        double ad = lcm( a,d );
        
        double a2 = ad/a;
        double b2 = b*a2;
        double c2 = c*a2;
        
        double d2 = ad/d;
        double e2 = e*d2;
        double f2 = f*d2;
        
        y = (c2-f2)/(b2-e2);
        x = (c-b*y)/a;
        
        printf("%.3lf",x);
        printf(" ");
        printf("%.3lf\n",y);
        
    }
    
}
double gcd( double m, double n )
{
	if ( ( 0.0 == m ) || ( 0.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.0 == m ) || ( 0.0 == n ) )
		return 0;
	
	return ((m / gcd(m, n)) * n);
}

C++: #include <iostream>
#include <iomanip>
using namespace std;
int main() {
int a,b,c,d,e,f;
while (cin>>a>>b>>c>>d>>e>>f) {
 double dx = c*e-b*f;
 double dy = a*f-c*d;
 double d  = a*e-b*d;
 cout << fixed << setprecision(4) << dx/d << ' ' << dy/d << endl;
 }
return 0;
}

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

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

	while(1){
		getline( cin, str );
		if( str.size()==0 ){
			break;
		}
		sscanf( str.c_str(), "%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f );

		double D  = a*e-b*d;
		double D1 = c*e-f*b;
		double D2 = a*f-d*c;
		cout << D << " " << D1 << " " << D2 << endl;
		x = D1 / D;
		y = D2 / D;

		bool isX = ( (c-a*x)/b == (f-d*x)/e );
		bool isY = ( (c-b*y)/a == (f-e*y)/d );
		cout << isX << " " << isY << endl;
		if( !isX && isY ){
			x = 0.0;
			y = c/b;
		}else if( isX && !isY ){
			y = 0.0;
			x = c/a;
		}else if( !isX && !isY ){
			x = y = 0.0;
		}

//		cout.form("%.3f %.3f\n", x, y );
		printf("%.3f %.3f\n", x, y);
	}

	return 0;
}

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

// ax + by = c
// dx + ey = f
// det(A) = ae-bd
// A^(-1) = 1/det(A)* ((e,-b),(-d,a))
// x = 1/det(A) *(ce-bf)
// y =			*(-cd+af)

int main(int,char**){
	double a,b,c,d,e,f;
	double x,y;
	std::cout<< std::setprecision(3) << std::setiosflags(std::ios::fixed);
	while(std::cin >> a){
		std::cin >> b >> c >> d >> e >> f;
		double det(a*e-b*d);
		x= (c*e-b*f)/det + 0;
		y= (-c*d+a*f)/det + 0;
		std::cout<< x << ' ' << y<<std::endl;
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main()
{
    double a,b,c,d,e,f,g,h;
    while(cin>>a>>b>>c>>d>>e>>f){
            h=0;g=0;
    h=(d*c-a*f)/(b*d-a*e);
    g=(c-b*h)/a;
    printf("%.3lf %.3lf\n",g,h);
    }
    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<iostream>
int main(){for(float a,b,c,d,e,f,x,y;;){std::cin>>a>>b>>c>>d>>e>>f;if(std::cin.eof())break;d&&b*d-a*e?(x=f/d-e*(c*d-a*f)/(b*d-a*e)/d,y=b?c/b-a*x/b:f/e-d*x/e):(y=(c*d-a*f)/(b*d-a*e),x=a?c/a-b*y/a:f/d-e*y/d);printf("%.3f %.3f\n",x,y);}}

C++: #include<iostream>
int main() {
  int a[6];
  for(int i=0;i<=5;i++) {
    scanf("%d",&a[i]);
  }
  char x,y;
  x=(a[2]*a[4]-a[1]*a[5])/(a[0]*a[4]-a[1]*a[3]);
  y=(a[2]*a[3]-a[0]*a[5])/(a[1]*a[3]-a[0]*a[4]);
  printf("%d"" ""%d",x,y);
}

C++: #include <bits/stdc++.h>

using namespace std;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(12);
  double a, b, c, d, e, f, x, y;
  while (cin >> a >> b >> c >> d >> e >> f) {
    x = (b * f - e * c) / (b * d - a * e);
    y = (c - a * x) / b;
    if (!x) x = 0;
    if (!y) y = 0;
    cout << x << ' ' << y << '\n';
  }
  return 0;
}

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

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

	cout << x << " " << y << "\n";

}

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

int main(){

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

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

C++: #include <stdio.h>
#include <math.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",floor((s*d-b*t)/(a*d-b*c)*1000+0.5)/1000,(a*t-s*c)/(a*d-b*c));
    }
    return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define MOD 1000000007
#define INF (1LL<<25)     //33554432
#define PI 3.14159265359
#define EPS 1e-12
//#define int ll

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

  return 0;
}