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

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

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){
		/*
		a = 2;
		b = -1;
		c = -3;
		d = 1;
		e = -1;
		f = -3;
		*/
		double x, y;
		x = (c * e - b * f) / (a * e - b * d);
		y = (c * d - a * f) / (b * d - a * e);
		if (x == -0.000) x = 0.000;
		if (y == -0.000) y = 0.000;
		cout << fixed << setprecision(3) << x << " " << y << endl;
	}
	return 0;
}

C++: #include <stdio.h>

int main(){
	double a,b,c,d,e,f;
	double x,y;
	while(scanf("%f %f %f %f %f %f",&a,&b,&c,&d,&e,&f)!=EOF){
	x=(c*e-f*b)/(a*e-d*b);
	y=(a*f-d*c)/(a*e-b*d);
	x=x*1000;
	if(x>0) x=(double)(int)(x+0.5);
	else  x=(double)(int)(x-0.5);
	x=x/1000;
	y= y*1000;
	if(y>0) y=(double)(int)(y+0.5);
	else y=(double)(int)(y-0.5);
	y=y/1000;
	printf("%.3f %.3f\n",x,y);
	}
	return 0;
}

C++: 
#include<stdio.h>

int main (void){

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

    double X,Y;

    scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f);

    Y = (c*d-f*a)/(b*d-e*a);

    X = (c*e-f*b)/(a*e-d*b);

    printf("%.3lf %.3lf\n",X ,Y);


    return 0;
}

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

using namespace std;

int main (int argc, char const* argv[])
{
    double a,b,c,d,e,f;
    double 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);

        x = round(x * 1000)/1000.0;
        y = round(y * 1000)/1000.0;
        
        if(x == 0)x = 0;
        if(y == 0)y = 0;
        
        printf("%.03lf %.03lf\n",x,y);
    }
    
    return 0;
}

C++: #include <stdio.h>
#include <vector>
#include <utility>
#include <algorithm>
#include <iostream>
#include <limits>
#include <iomanip>
using namespace std;
#define rep(i,n) for(int i=0;i<n;++i)
#define ld long double
ld a, b, c, d, e, f, x, y;
ld shish(ld a)
{
	if (a == 0) { return a; }
	
	a *= 1000;
	if (a > 0) {
		a += 0.51;
	}
	else {
		a -= 0.51;
	}
	a = (ld)((int)a);
	a /= 1000;
	return a;
}
int main() {
	while (cin >> a >> b >> c >> d >> e >> f) {
		y = (a*f - c*d) / (ld)(a*e - b*d);
		x = (c*e - f*b) / (ld)(a*e - b*d);

		x = shish(x);
		y = shish(y);
		if (x == 0) { cout << "0.000"; }
		else {
			cout << fixed << setprecision(3) << x;
		}
		cout << " ";
		if (y == 0) { cout << "0.000" << endl; }
		else{
			cout << fixed << setprecision(3) << y << endl;
		}
	}
	return 0;
}

C++: #include <stdio.h>
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-c*e)/(b*d-a*e);
        y=(c*d-f*a)/(b*d-a*e);
        if(x==-0)x=0;
        if(y==-0)y=0;
        printf("%.3lf %.3lf\n",x,y);
    }
}

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

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

	std::cout << std::fixed << std::setprecision(3);
	while (std::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);
		if (x == -0) x = 0;
		if (y == -0) y = 0;
		std::cout << x << " " << y << std::endl;
	}

	return 0;
}

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

C++: #define _USE_MATH_DEFINES
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <sstream>
#include <map>
#include <set>
#include <cstdio>
using namespace std;

#define REP(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
/* ここからが本編 */
/* */
/* 入力開始！ */
/* 入力終了！ */
int main(void)
{
   int n;
   double a,b,c,d,e,f;
   double x,y;
   while(cin >> a) {
      cin >> b >> c >> d >> e >> f;
      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>
#include<iomanip>
#define x_Formula(a,b,c,d,e,f) (c-(b*f)/e)/(a-(b*d)/e);
#define y_Formula(x,a,b,c) (c-(a*x))/b;

using namespace std;

double num[6];

void serch(double s_x,double s_y)
{
	int xx,yy;
	xx=s_x*10000.0;
	yy=s_y*10000.0;
	if((xx*10000)%10>4)
		s_x+0.001;
	if((yy*10000)%10>4)
		s_y+0.001;
}
int main()
{
	int i;
	
	for(;cin >> num[0];)
	{
		for(i=1;i<6;i++)
			cin >> num[i];
		
		double x=x_Formula(num[0],num[1],num[2],num[3],num[4],num[5])
		double y=y_Formula(x,num[0],num[1],num[2])
		
		cout << setprecision(3);
		cout << setiosflags(ios::scientific);
		cout << fixed ;
		serch(x,y);
		cout << x << " " << y << endl;
	}
}

C++: #include<stdio.h>
int main(void)
{
	float e2,f2,c2;
	float a1,b1,c1,d1,e1,f1;
	float a,b,c,d,e,f;
	float add,x,y;
	while(scanf("%f %f %f %f %f %f",&a,&b,&c,&d,&e,&f)!=EOF){
		add=a/d;
		a1=a;
		b1=b;
		c1=c;
		d1=d*add;
		e1=e*add;
		f1=f*add;
		e2=b-e1;
		f2=c-f1;
		y=f2/e2;
		add=b/e;
		a1=a;
		b1=b;
		c1=c;
		d1=d*add;
		e1=e*add;
		f1=f*add;
		a1=a-d1;
		c2=c-f1;
		x=c2/a1;
		printf("%f %f\n",x,y);
	}
	return 0;
}
/*
1x+2y=3
4x+5y=6
a  b  c
1x+2y=3;
1.6x+2y=1.2
d    e   f
-0.4x=1.8
*/

C++: #define _CRT_SECURE_NO_WARNINGS
#include <iomanip>
#include <iostream>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <cmath>
#include <sstream>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
#define all(c) (c).begin(), (c).end()
#define loop(i,a,b) for(ll i=a; i<ll(b); i++)
#define rep(i,b) loop(i,0,b)
#ifdef DEBUG
#define dump(...) (cerr<<#__VA_ARGS__<<" = "<<(DUMP(),__VA_ARGS__).str()<<" ["<<__LINE__<<"]"<<endl)
struct DUMP:ostringstream{template<class T>DUMP &operator,(const T&t){if(this->tellp())*this<<", ";*this<<t;return *this;}};
#else
#define dump(...)
#endif

ll cross(ll a, ll b, ll c, ll d) {
    return a*d - b*c;
}

int main() {
    ll a[6];
    while(cin) {
        rep(i,6) cin>>a[i];
        if(!cin) break;
        ll d =  cross(a[0], a[1], a[3], a[4]);
        ll x1 = cross(a[2], a[1], a[5], a[4]);
        ll x2 = cross(a[0], a[2], a[3], a[5]);
        cout << setprecision(3) << fixed;
        cout << 1. * x1 / d + 1e-9 << " ";
        cout << 1. * x2 / d + 1e-9 << endl;
    }
}