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 := cF / bE
		x := (c - (y * b)) / a

		fmt.Printf("%d.000 ", x)
		fmt.Printf("%d.000\n", y)
	}
}

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

int main(){
  for(double a1,b1,c1,d1,e1,f1,a2,b2,c2,d2,e2,f2,a3,b3,c3,d3,e3,f3,x,y;cin>>a1>>b1>>c1>>d1>>e1>>f1;){

    a2=a1*d1;
    b2=b1*d1;
    c2=c1*d1;

    d2=a1*d1;
    e2=a1*e1;
    f2=a1*f1;

    y=(c2-f2)/(b2-e2);

    a3=a1*e1;
    b3=b1*e1;
    c3=c1*e1;

    d3=b1*d1;
    e3=b1*e1;
    f3=b1*f1;

    x=(c3-f3)/(a3-d3);

    printf("%.3f %.3f\n",x,y);
  }
  return 0;
}

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

C++: #include<stdio.h>
#include<math.h>
int main(void){
    double a,b,c,d,e,f,A,x,y,X,Y,Z;

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

    Y=b-e,Z=c-f;
    y=Z/Y;
    x=(c-y*b)/a;
    x=x+0.0005,y=y+0.0005;
    x=x*1000,y=y*1000;
    x=floor(x);
    y=floor(y);
    x=x/1000,y=y/1000;
    if(x==-0)x=0;
    if(y==-0)y=0;
   printf("%.3lf %.3lf\n",x,y);
    }
   // printf("\na%lf\nb%lf\nc%lf\nd%lf\ne%lf\nf%lf\n%lf\n%lf",a,b,c,d,e,f,Y,Z);

    return 0;
}

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

int main()
{
    int a,b,c,d,e,f;
    double x,y;
    for(int i=0;i<2;i++){
        cin>>a>>b>>c>>d>>e>>f;
        double l,m,n;
        l=a/d;
        m=b-e*l;
        n=c-f*l;
        y=n/m;
        x=(c-b*y)/a;
        cout<<x<<" "<<y<<endl;
    }
    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
#define all(vec) vec.begin(),vec.end()
typedef long long int ll;
typedef pair<int,int> P;
const ll MOD=1000000007;
const ll INF=1000000010;
const ll LINF=4000000000000000010LL;
const int MAX=310;
const double EPS=1e-8;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
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=(-b*y+c)/a;
        x*=1000;
        printf("%.3f ",round(x)/1000);
        y*=1000;
        printf("%.3f\n",round(y)/1000);
    }
}

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

int main()
{
	double A, B, C, D, E, F, X, Y, G , H;

	while(cin >> A >> B >> C >> D >> E >> F)
	{
		G = A / D;
		D *= G;
		E *= G;
		F *= G;
		Y = (F-C) / (E-B);
		
		D /= G;
		E /= G;
		F /= G;
		H = B / E;
		D *= H;
		E *= H;
		F *= H;
		X = (F-C) / (D-A);

		X= floor(X*1000+0.5)/1000;
		Y= floor(Y*1000+0.5)/1000;

		if(Y==0){
			Y=0;
		}

		if(X==0){
			X=0;
		}

		cout<<fixed<<setprecision(3)<<X<<" "<<fixed<<setprecision(3)<<Y<<endl;
	}

	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 < 1) {
		cin >> a >> b >> c >> d >> e >> f;
#else
	while (cin >> a >> b >> c >> d >> e >> f) {
#endif
		if (
			((a < -1000) && ( 1000 < a)) ||
			((b < -1000) && (1000 < b)) ||
			((c < -1000) && (1000 < c)) ||
			((d < -1000) && (1000 < d)) ||
			((e < -1000) && (1000 < e)) ||
			((a < -1000) && (1000 < f))
			) {
			break;
		}
		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++) {
		std::cout << std::fixed << std::setprecision(3) << x_vector[i] << " ";
		std::cout << std::fixed << std::setprecision(3) << y_vector[i] << endl;
	}

	cnt = 0;
	x_vector.clear();
	y_vector.clear();

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

	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main(){
	long long a,b,c,d,e,f;
	double x,y;
	while(cin >> a >> b >> c >> d >> e >> f){
		x=(double)(c*(a*e-b*d)-b*(a*f-c*d))/(double)(a*(a*e-b*d));
		y=(double)(a*f-c*d)/(double)(a*e-b*d);
		if(x==-1*0)x=0;
		if(y==-1*0)y=0;
		printf("%.6lf %.6lf\n",x,y);
	}
	return 0;
}

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

double halfadjust(double x){
	int tmp = static_cast<int>(x*10000);
	double ans = static_cast<double>(tmp)/10000;
	tmp = tmp%10;
	if(tmp >= 5)
		ans += 0.001;
	return ans;
}

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

void solve(){
	double x = (c*e-b*f)/(a*e-b*d);
	double y = (c*d-a*f)/(b*d-a*e);
	cout << setprecision(3) << fixed << halfadjust(x) << ' ';
	cout << halfadjust(y) << std::endl;
	//cout << setprecision(6);
}

int main(){
	while(cin >> a && cin >> b && cin >> c && cin >> d && cin >> e && cin >> f){
		if((!a&&!b)||(!d&&!e))
			break;
		solve();
	}
	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){
		if (a*d<0){
			d = -d;
			e = -e;
			f = -f;
		}

		x = (c - b*(c - f*a / d) / (b - e*a / d)) / a;
		y = (c - f*a / d) / (b - e*a / d);
		if (x == 0)x = 0;
		if (y == 0)y = 0;
		x = round(x);
		y = round(y);
		std::cout<<std::fixed<<std::setprecision(4)  << x << " " << y << std::endl;
	}
	return 0;

}

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

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

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

    return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <string>
#include <set>
#include <queue>
#include <stack>
#include <cmath>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long > vll;
typedef vector< vi > vvi;
int main() {
	float a,b,c,d,e,f,x,y;
	while(true){
		cin>>a>>b>>c>>d>>e>>f;
		if (cin.eof())break;
		x=c*e-b*f;
		y=a*f-c*d;
		x/=a*e-d*b;
		y/=a*e-d*b;
		printf("%.3f %.3f\n",x,y);
	}
}

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

int det(int a00, int a01, int a10, int a11)
{
	return a00*a11 - a01*a10;
}

int main()
{
	int a, b, c, d, e, f;
	while (cin >> a >> b >> c >> d >> e >> f)
	{
		int t = det(a, b, d, e);
		cout << fixed << setprecision(3) << (double)det(c, b, f, e) / t << ' ' << (double)det(a, c, d, f) / t << endl;
	}
	return 0;
}