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 <stdio.h>
#include <iostream>

using namespace std;

int main(int argc, char* argv[])
{
	double a, b, c, d, e, f;
	double b1, c1, e1, f1;
	double x, y;

	while (cin >> a >> b >> c >> d >> e >> f) {
		b1 = b * d;
		c1 = c * d;
		e1 = e * a;
		f1 = f * a;

		if (b1 == e1) continue;
		y = (c1 - f1) / (b1 - e1);
		x = (c - b * y) / a;
		printf("%.3f %.3f\n", x, y);
	}
	
	return 0;
}

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

double mround(double a){
	if(a<0.0)return a-0.0005;
	return a+0.0005;
}
int main(){
	double a[6];
	double x,y;
	while(cin>>a[0]>>a[1]>>a[2]>>a[3]>>a[4]>>a[5]){
		double b=a[1]/a[4];
		for(int i=0;i<3;i++)a[3+i]*=b;
		x=(a[2]-a[5])/(a[0]-a[3]);
		y=(a[2]-x*a[0])/a[1];

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


	return 0;
}

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

int main() {
    string line;
    while (getline(cin, line)) {
        int a, b, c, d, e, f;
        stringstream ss(line);
        ss >> a >> b >> c >> d >> e >> f;

        double x = 0.0;
        if (c*e != b*f)
            x = static_cast<double>(c*e - b*f) / (a*e - b*d);
        double y = static_cast<double>(c - a*x) / b;
        cout.precision(4);
        cout << showpoint << x << " " << y << endl;
    }
}

C++: #include <cstdio>
#include <iostream>
#include <functional>
#include <algorithm>
#include <string>
#include <cstdarg>
#include <vector>
#include <map>
#include <cmath>

using namespace std;

namespace _{struct _{_(){ // initialize
  cin.tie(0); ios::sync_with_stdio(false);
}}_;}

template <typename T, size_t size>
inline size_t len(const T (&)[size]) { return size; }
inline void println(string s) { cout << s << '\n'; }
inline string format(const char* fmt, ...){
  int size = 512;
  char* buffer = 0;
  buffer = new char[size];
  va_list vl;
  va_start(vl, fmt);
  int nsize = vsnprintf(buffer, size, fmt, vl);
  if (size <= nsize) { //fail delete buffer and try again
    delete[] buffer;
    buffer = 0;
    buffer = new char[nsize+1]; //+1 for /0
    nsize = vsnprintf(buffer, size, fmt, vl);
  }
  string ret(buffer);
  va_end(vl);
  delete[] buffer;
  return ret;
}
#define str to_string
#define rep(i, n) for (int i=0; i<int(n); i++)
#define all(c) (c).begin(), (c).end()
#define max(a, b, c) max(max((a), (b)), (c))
#define min(a, b, c) min(min((a), (b)), (c))


// ax + by = c     || ax = c - by
// dx + ey = f
// x + (b/a)y = c/a
// x + (e/d)y = f/d
// (b/a - e/d)y = c/a - f/d
// y = (c/a - f/d) / (b/a - e/d)
// x = c/a - (b/a)y
int main() {
  double a, b, c, d, e, f;
  string ret = "";
  while (cin >> a >> b >> c >> d >> e >> f) {
    double x = 0, y = 0;
    if (a == 0) {
      y = b/c;
      x = f/d - e*y/d;
    }
    else if (d == 0) {
      y = e/f;
      x = c/a - b*y/a;
    }
    else if (b == 0) {
      x = c/a;
      y = f/e - d*x/e;
    }
    else if (e == 0) {
      x = f/d;
      y = c/b - a*x/b;
    }
    else {
      y = (c/a - f/d) / (b/a - e/d);
      x = c/a - (b/a)*y;
    }

    double a = round(x * 1000);
    double b = round(y * 1000);
    ret += format("%.3f %.3f\n",a / 1000, b / 1000);
  }
  cout << ret;
}

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

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

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

C++: #include <iostream>
#include <stack>
#include <map>
#include <algorithm>
#include <sstream>
#include <queue>
#include <string>
#include <iomanip>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cmath>
using namespace std;
#define F first
#define S second
const int INF=100000000;


int main(){
	double a,b,c,d,e,f;
	while(cin>>a>>b>>c>>d>>e>>f){
		double x,y;
		x=(c*e-b*f)/(e*a-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);
		//cout << setprecision(3)  << x << " " << y << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <iomanip>
int main(void)
{
    double a,b,c,d,e,f;
    double x,y;
    std::cout << std::showpoint << std::setprecision(4);
    while(std::cin >> a >> b >> c >> d >> e >> f){
        x = (c * e - b * f) / (a * e - b * d) * 1000;
        x = (int)(x + (x >= 0 ? 0.5 : -0.5)) / 1000.0;
        y = (f * a - c * d) / (a * e - b * d) * 1000;
        y = (int)(y + (y >= 0 ? 0.5 : -0.5)) / 1000.0;
        std::cout << x << " " << y << std::endl;
    }
    return 0;
}

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

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

  scanf("%lf %lf %lf %lf %lf %lf", &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)<<fabs(x)<<" "<<fabs(y)<<endl;
  return EXIT_SUCCESS;
}

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

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

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

using namespace std;

/*
aX+bY=c
dX+eY=f
*/

void solve(int a, int b, int c, int d, int e, int f) {
	double x = (double)(f - (double)e*c/b) / (d - (double)e*a/b);
	double y = ((double)c - a*x) / b;
	printf("%4.3f %4.3f\n", x, y);
}

int main() {
	int a, b, c, d, e, f;
	while (cin >> a >> b >> c >> d >> e >> f) {
		solve(a,b,c,d,e,f);
	}
	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 = (a*f - c*d)/(a*e - d*b);
    y = (c -b*y)/a;
    printf("%.3f %.3f",x,y);
  }
}

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

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", x, y);
	}

	return 0;

}