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 <stdio.h>
#define swap(a,b) {a=a+b; b=a-b; a=a-b;}
using namespace std;

void q4() {
	double a, b, c, d, e, f;
	for (;;) {
		cin >> a >> b >> c >> d >> e >> f;
		//scanf_s("%lf %lf %lf %lf %lf %lf\n", &a, &b, &c, &d, &e, &f);

		if (a == 0) {
			swap(a, d);
			swap(b, e);
			swap(c, f);
		}
		b /= a;
		c /= a;
		a = 1;

		e -= b * d;
		f -= c * d;
		d = 0;

		f = f / e;
		e = 1;
		
		c -= f * b;
		b = 0;

		printf("%4lf %4lf\n", c, f);
	}
}

int main() {
	q4();
	return 0;
}

C++: #include<iostream>
#include<stdio.h>
using namespace std;
double dat(double a,double b,double c,double d) {
	return a*d - b*c;
}
int main() {
	double a,b,c,d,e,f;
	while(cin >> a >> b >> c >> d >> e >> f) {
		// クラメルの公式を利用
		double A = dat(a,b,d,e);
		//if(A == 0)
		//	cout << "error" << endl;
		double A1 = dat(c,b,f,e);
		double A2 = dat(a,c,d,f);
		
		// x y
		double x = A1/A;
		double y = A2/A;
		
		// 小数点第4位で四捨五入
		int x_cp;
		int y_cp;
		if(x < 0)
			x_cp = (int)(x*1000 - 0.5);
		else
			x_cp = (int)(x*1000 + 0.5);
		if(y < 0)
			y_cp = (int)(y*1000 - 0.5);
		else
			y_cp = (int)(y*1000 + 0.5);
		
		x = (double)x_cp / 1000;
		y = (double)y_cp / 1000;
		
		printf("%.3lf %.3lf\n",x,y);
	}
	return 0;
}

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

int main(){
    float a, b, c, d, e, f, x, y, dividedNum1, dividedNum2 = 0;
    while(cin >> a >> b >> c >> d >> e >> f){
        dividedNum1 = a;
        dividedNum2 = d;
        a /= dividedNum1;
        b /=dividedNum1;
        c /= dividedNum1;
        d /= dividedNum2;
        e /= dividedNum2;
        f /= dividedNum2;
        
        float temp1 = b - e;
        float temp2 = c - f;
        
        y = floor((temp2 / temp1) * 1000 + 0.0005) / 1000;
        x = floor((c - (b * y) ) * 1000 + 0.0005) / 1000;
        
        cout << fixed << setprecision(3) << x << " " << 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;
  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", floor(x * 1000.0) / 1000.0, floor(y * 1000.0) / 1000.0);
  return 0;
}

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 det = a*e - b*d;
    double x = (e*c-b*f)/det;
    double y = (-d*c+a*f)/det;

    cout.setf(ios::showpoint);
    cout.precision(4);
    cout << x << ' ' << y << endl;

  }
  return 0;
}

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

using namespace std;

#define rep(i, n) for (int i = 0; i < int(n); ++i)

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

C++: #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cctype>
#include<algorithm>
#define pf printf
#define sf scanf
#define wh while
#define db double
#define LL long long
#define _USE_MATH_DEFINES
#define re(i,a,b) for(int i=a;i<b;i++)
#define rev(i,a,b) for(int i=a;i>=b;i--)

using namespace std;

int main()
{
    db a,b,c,d,e,f,x,y;
    wh(sf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f)==6){
        if((e*c-b*f)==0)x=0;
        else x=(e*c-b*f)/(a*e-b*d);
        y=(c-a*x)/b;
        pf("%.3lf %.3lf\n",x,y);
    }
    return 0;
}

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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // ????????§ ax+by=c, dx+ey=f ????§£?????????????????¨???????????¨???????¨????????????????(1)
    vector<vector<double>> answers;
    double a, b, c, d, e, f;
    int dump;
    while(cin >> a >> b >> c >> d >> e >> f) {
        double det = (double)(a*e-b*d);
        double ansx = (e*c+(-b)*f)/det;
        double ansy = ((-d)*c+a*f)/det;
        answers.push_back({ansx,ansy});
    }
    for(auto elm : answers) {
        cout << fixed << setprecision(3) << elm[0] << " " << elm[1] << endl;
    }

    return 0;
}

C++: #include <iostream>
#include <iomanip>
#define REP(i,n) for(int i=0;i<n;i++)
using namespace std;

int main() {
    int a[3];
    int b[3];
    int y[3];
    int x[3];
    while(true) {
    REP(i,3)
        cin >> a[i];
    REP(i,3)
        cin >> b[i];
    if(!cin)
        return 0;
    double o[2];
        o[0] = b[1]*a[2] - a[1]*b[2];
        o[1] = -b[0]*a[2] + a[0]*b[2];
    REP(i,2)
        o[i] = (o[i]==0)?0:o[i]/(a[0]*b[1]-b[0]*a[1]);
    cout << fixed << setprecision(3) << o[0] << ' ';
    cout << fixed << setprecision(3) << o[1] << '\n';
    }
}

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

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

C++: // http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0004
#include <bits/stdc++.h>
using namespace std;

int main(){
  for(double a,b,c,d,e,f,x,y; cin>>a>>b>>c>>d>>e>>f;){
    x = (e*c+(-b)*f)/(a*e-b*d);
    y = ((-d)*c+a*f)/(a*e-b*d);

    cout<<fixed; // ?°???°?????\??????????????????????????????????????????????????°???????????°??????????????????
    cout<<setprecision(3)<<x<<" "<<y<<endl;
  }
  return EXIT_SUCCESS;
}

C++: ///
// File:  0004.cpp
// Author: ymiyamoto
//
// Created on Wed Nov  8 21:45:53 2017
//

#include <cstdint>
#include <iomanip>
#include <iostream>

using namespace std;

int32_t main()
{
  while (true) {
    double a, b, c, d, e, f;
    cin >> a >> b >> c >> d >> e >> f;
    if (cin.eof()) break;

    double x = (e * c - b * f) / (a * e - b * d);
    double y = (a * f - d * c) / (a * e - b * d);
    cout << fixed;
    cout << setprecision(3) << x + 0.0 << " " << y + 0.0 << endl;
  }

  return 0;
}

C++: #include <stdio.h>
main(){
 double x,y,a,b,c,d,e,f;
  while(scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f) !=EOF){
    if(a!=0&&a*e!=0&&c/a-(b*f)/(a*e)!=0&&1-b*d/(a*e)!=0){
      x=(c/a-(b*f)/(a*e))/(1-b*d/(a*e));
      y=(f-d*x)/e;
    }
    else if(a==0){
      y=c/b;
      x=(f-e*y)/d;
    }
    else if(e==0){
      x=f/d;
      y=(c-a*x)/b;
    }
    else{    
      x=(f/d-(e*c)/(b*d))/(1-a*e/(b*d));
      y=(f-d*x)/e;
    }

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