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 <stdlib.h>
#include <string.h>
#include <sstream>
#include <iostream>
#include <math.h>
#include <iomanip>

using namespace std;

string float_to_string(float f, int digits)
{
  if (f == 0) {
    f = 0;
  }
  ostringstream oss;
  oss << setprecision(digits) << setiosflags(ios::fixed) << f;
  return oss.str();
}

void calc_and_output(int *c)
{
  float x = (float)(c[1]*c[5]-c[2]*c[4])/(c[1]*c[3]-c[0]*c[4]);
  float y = (float)(c[0]*c[5]-c[2]*c[3])/(c[0]*c[4]-c[1]*c[3]);

  cout << float_to_string(x, 3) << " " << float_to_string(y, 3) << endl;
}

int main(int argc, char const* argv[])
{
  int c[6];

  string line;
  while (getline(cin, line)) {
    istringstream iss(line);
    int val;
    int c[6];
    for (int i = 0; i < 6; i++) {
      iss >> val;
      c[i] = val;
    };

    calc_and_output(c);
  }

  return 0;
}

C++: // http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0004&lang=jp
#include <algorithm>
#include <vector>
#include <iostream>
#include <math.h>
//#include <bits/stdc++.h>	//C++標準ライブラリ一括読み込み
using namespace std;

// ax+by=c
// dx+ey=f
double unko(double x){
	int y=int(round(x*1000));
	return double(y/1000);
}

int main(){
    double a,b,c,d,e,f;
    cin>>a>>b>>c>>d>>e>>f;
//	long long x=(c*e-b*f)/(a*e-b*d)+0.0005;
//	long long y=(c*d-a*f)/(b*d-a*e)+0.0005;
//	printf("%.3f %.3f",x,y);
	double x=(c*e-b*f)/(a*e-b*d);
	double y=(c*d-a*f)/(b*d-a*e);
	printf("%.3f %.3f",unko(x),unko(y));
    return 0;
}

C++: #include <cstdio>
using namespace std;
float a,b,c,d,e,f,t;
int main(){
  for(;~scanf("%f%f%f%f%f%f",&a,&b,&c,&d,&e,&f);
    t=a*e-b*d,printf("%.3f %.3f\n",(e*c-b*f)/t+0.,(a*f-d*c)/t+0.)
  );
  return 0;
}

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

int main(){
	double a[6];
	double x,y;
	cout<< setprecision(4) << setiosflags(ios::showpoint);
	while(true){
		if(cin.eof())
			break;
		cin >> a[0];
		cin >> a[1];
		cin >> a[2];
		cin >> a[3];
		cin >> a[4];
		cin >> a[5];

			
		x = (a[4]*a[2]-a[1]*a[5])/(a[0]*a[4]-a[1]*a[3]);
		y = (-a[3]*a[2]+a[0]*a[5])/(a[0]*a[4]-a[1]*a[3]);
		if(x == 0)
			x = 0;
		if(y == 0)
			 y = 0;
			 
		cout << x << " " << y << endl;
	}
	return 0;
}

C++: #include <cstdio>

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

void solve(){
	double x = 1.0 * (c * e - b * f) / (a * e - b * d);
	double y = (c - a * x) / b;
	if(x == -0)x = 0;
	if(y == -0)y = 0;
	printf("%.3lf %.3lf\n", x, y);
}

int main(int argc, char const *argv[]){
//	freopen("in.txt", "r", stdin);

	while(scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f) != EOF){
		solve();
	}
	
	return 0;
}

C++: #include<bits/stdc++.h>
using ll = long long;
using namespace std;

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

		x = round(x*1000)/1000+10e-5;
		y = round(y*1000)/1000+10e-5;

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

	return 0;
}

C++: #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define vi vector<int>
#define pb push_back
#define INF 999999999

const double EPS = 1e-8;
typedef vector<double> vd;
typedef vector<vd> mat;

//Ax=b????§£??? A?????£?????????
//?§£??????or????????§?????? ??´????????????0???vector?????????
vd gauss_jordan(const mat& A, const vd& b){
    int n=A.size();
    mat B(n,vd(n+1));
    rep(i,n) rep(j,n) B[i][j]=A[i][j];
    
    rep(i,n) B[i][n] = b[i];                                    //??????A????????????b?????????????????????????????????
    
    rep(i,n){
        int pivot = i;
        for(int j=i;j<n;j++){                                   //??¨????????????????????°????????°?????¶???????????§????????????i??????????????£?????????
            if(abs(B[j][i])>abs(B[pivot][i]))pivot = j;
        }
        swap(B[i],B[pivot]);
        
        if(abs(B[i][i])<EPS)return vd();                        //?§£??????or????????§??????
        
        for(int j=i+1;j<=n;j++)B[i][j]/=B[i][i];                //??¨????????????????????°????????°???1?????????
        rep(j,n){
            if(i!=j){
                for(int k=i+1;k<=n;k++)B[j][k]-=B[j][i]*B[i][k];//j??????????????°????¶????
            }
        }
    }
    vd x(n);
    rep(i,n)x[i]=B[i][n];    //??????????????????b????§£?????????
    return x;
}

int main(){
    int a,b,c,d,e,f;
    while(cin>>a>>b>>c>>d>>e>>f){
        vd vec;
        vec.pb(c);
        vec.pb(f);
        mat mvec;
        vd x,y;
        x.pb(a);
        x.pb(b);
        y.pb(d);
        y.pb(e);
        mvec.pb(x);
        mvec.pb(y);
        vd res = gauss_jordan(mvec, vec);
        printf("%.3lf %.3lf\n",res[0],res[1]);
    }
}

C++: #include<iostream>
#include<iomanip>
using namespace std;
int main(void) {
    double a, b, c, d, e, f;
    while(cin >> a >> b >> c >> d >> e >> f){
        double x = (f - (c*e/b)) / (d - ((a*e)/b));
        double y = (c/b) - (a/b) * x;

        cout << fixed;
        cout << setprecision(3) << x << ' ' << y << endl;
    }
}

C++: #include <iostream>
#include <cstdio>
int main(void){
	double a,b,c,d,e,f,x,y;
	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;
		printf("%.3f %.3f\n",x,y);
	}
}

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

int main(){
	double a,b,c,d,e,f;
	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*(-c*d + a*f);	
        if(x == -0.0) x=0;
        if(y == -0.0) y=0;

		cout << fixed << setprecision(3) << x << ' ' << y <<endl;
	}
	return 0;
}