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<math.h>
#include<algorithm>
#include<string.h>
using namespace std;
int main(){
    double a,b,c,d,e,f,x,y;
    while(cin>>a>>b>>c>>d>>e>>f){
    x=(double)((e*c-f*b)/(a*e-b*d));
    y=(double)((-(d*c)+a*f)/(a*e-b*d));
    if(x==0){
        x=0;
    }
    if(y==0){
        y=0;
    }
    printf("%.3f %.3f\n",x,y);
    return 0;
    }
}

C++: #include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
int main() {
  int 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);
    printf("%.3f %.3f\n", round(x * 1000)/1000, round(y*1000)/1000);
  }
  return 0;
}

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

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

int main()
{
    double a,b,c,d,e,f;
    double x,y;
    
    while(cin >> a >> b >> c >> d >> e >> f){
        if(b*d - a*e != 0){
         
         double tmp1 = (c*e - b*f),tmp2 = (a*e - b*d),tmp3 = (c*d - a*f),tmp4=(b*d - a*e);
        tmp1 = tmp1/tmp2;
        tmp2 = tmp3/tmp4;
        x = tmp1;
        y = tmp2;
	if(x < 0.0001 && x > -0.0001) x = 0;
	if(y < 0.0001 && y > -0.0001) y = 0;
         printf("%.3f %.3f",x,y);
        }
    }
    return 0;
}

C++: #include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>
#define rep(i,n) for(int i=0;i<n;i++)
typedef int long long ll;

using namespace std;
int main(){

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

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> P;

#define EACH(i,a) for (auto& i : a)
#define FOR(i,a,b) for (ll i=(a);i<(b);i++)
#define RFOR(i,a,b) for (ll i=(b)-1;i>=(a);i--)
#define REP(i,n) for (ll i=0;i<(n);i++)
#define RREP(i,n) for (ll i=(n)-1;i>=0;i--)
#define debug(x) cout<<#x<<": "<<x<<endl
#define pb push_back
#define ALL(a) (a).begin(),(a).end()

const ll linf = 1e18;
const int inf = 1e9;
const double eps = 1e-12;
const double pi = acos(-1);

template<typename T>
istream& operator>>(istream& is, vector<T>& vec) {
	EACH(x,vec) is >> x;
	return is;
}
template<typename T>
ostream& operator<<(ostream& os, vector<T>& vec) {
	REP(i,vec.size()) {
		if (i) os << " ";
		os << vec[i];
	}
	return os;
}
template<typename T>
ostream& operator<<(ostream& os, vector< vector<T> >& vec) {
	REP(i,vec.size()) {
		if (i) os << endl;
		os << vec[i];
	}
	return os;
}

int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	int a, b, c, d, e, f;
	while ( cin >> a >> b >> c >> d >> e >> f ) {
		ll delta = a * e - b * d;
		ll x = c * e - b * f;
		ll y = a * f - c * d;
		cout << fixed << setprecision(3) << (ld)x/delta << " " << (ld)y/delta << endl;
	}
}

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

C++: #include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
int main() {
  int 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);
    printf("%.3f %.3f\n", x, y);
  }
  return 0;
}

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

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

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double ESP=1e-10;
using namespace std;
int main(){
  double a,b,c,d,e,f;
  while(cin>>a){
    cin>>b>>c>>d>>e>>f;
    double x=(c*e-b*f)/(a*e-b*d);
    double y=(f-d*x)/e;
    if(x==0)x=0;
    if(y==0)y=0;
    x+=0.00049999;y+=0.0004999;
    printf("%.3f %.3f\n",x,y);
  }
}

    
    /*
      ey=f-dx
      y=(f-dx)/e
      ax+b(f-dx)/e=c
      aex+df-bdx=ce
      (ae-bd)x=ce-df
      x=(ce-df)/(ae-bd)

  y=(f-dx)/e
  y=(f



a b  x  c
d e  y  f

x  c  e -b
y  f  -d a  /(ae-bd)*/

C++: #include<cstdio>
#include<cmath>
int main(){
    double a[6];
    double x,y;
    for(;;){
        for(int i=0;i<6;i++){
            if(scanf("%lf",&a[i])==-1)return 0;
        }
        if(a[0]==0){
            y=a[2]/a[1];
            x=(a[5]-a[4]*y)/a[3];
        }else if(a[1]==0){
            x=a[2]/a[0];
            y=(a[5]-a[3]*x)/a[4];
        }else if(a[3]==0){
            y=a[5]/a[4];
            x=(a[2]-a[1]*y)/a[0];
        }else if(a[4]==0){
            x=a[5]/a[3];
            y=(a[2]-a[0]*x)/a[1];
        }else{
            y=(a[2]-(a[5]*(a[0]/a[3])))/(a[1]-(a[4]*(a[0]/a[3])));
            x=(a[2]-a[1]*y)/a[0];
        }
        printf("%.3lf %.3lf\n",rint(x*1000)/1000.0,rint(y*1000)/1000.0);
    }
}

C++: #include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <stdio.h>
using namespace std;
int main() {
    double a,b,c,d,e,f;
    double x,y;
    while (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);
    }
}

C++: #include<cstdio>
int main(void)
{
	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)
	{
		y=(a*f-d*c)/(-(d*b)+a*e);
		x=(c-b*y)/a;
		if(x==0)
		{
			x=0;
		}
		if(y==0)
		{
			y=0;
		}
		printf("%.3lf %.3lf\n",x,y);
	}
	return 0;
}
/*
ax=c-by
->x=(c-by)/a
d((c-by)/a)+ey=f
(dc-dby)/a+ey=f
(dc-dby)+aey=af
-dby+aey=af-dc
y(-db+ae)=af-dc
->y=(af-dc)/(-db+ae)
*/