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

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

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

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

	return 0;
}

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

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

C++: #include <stdio.h>

int main(){
	int a,b,c,d,e,f;
	double x,y;
	while(scanf("%d%d%d%d%d%d", &a, &b, &c, &d, &e, &f) != EOF){
		x = (e*c-b*f)/(e*a-b*d);
		y = (d*c-a*f)/(b*d-a*e);

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

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

using namespace std;

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

  while((scanf("%lf%lf%lf%lf%lf%lf", &a, &b, &c, &d, &e, &f)) != -1) {
    double x, y;
    double denom = a * e - b *d;
    double nomer_x = c*e - b*f;
    double nomer_y = -c*d + a*f;
    x = nomer_x / denom;
    y = nomer_y / denom;

    if(x == 0) { x = 0;  }
    if(y == 0) { y = 0;  }

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

  return 0;
}

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

int main() {
	double a , b, c, d, e, f, x, y;
	cin >> a >> b >> c >> d >> e >> f;
	a *= 1000;
	b *= 1000;
	c *= 1000;
	d *= 1000;
	e *= 1000;
	f *= 1000;
	y = (d * c - a * f) / (d * b - a * e);
	x = (c - b * y) / a;
	cout << x / 1000 << " " << y / 1000 << endl;
	return 0;
}

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

int main(){
	int i = 0;
	while (i<=1){
		double a, b, c, d, e, f;
		cin >> a >> b >> c >> d >> e >> f;

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

	return 0;
}

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

C++: #include <stdio.h>


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

    while (scanf("%lf %lf %lf %lf %lf %lf", 
    &a, &b, &c, &d, &e, &f)==6){
        x = (e*c-b*f)/(a*e-b*d);
        y = (-d*c+a*f)/(a*e-b*d);
        // round
        tmp = (int)(x*1000) % 10;
        if (x<5) x -= tmp/1000;
        if (x>=5) x += (10-tmp)/1000;
        tmp = (int)(y*1000) % 10;
        if (y<5) y -= tmp/1000;
        if (y>=5) y += (10-tmp)/1000;
        // output
        printf("%.3f %.3f\n", x, y);
    }
    return 0;
}

C++: #include <stdio.h>
double round3(double a){
	a=a*10000;
	if(int(a)%10>5)a=a+10-int(a)%10;
	a=double (int (a/10));
	a=a/10000;
	return a;
}

int main(){
	int a,b,c,d,e,f;
	double x,y;
	while((scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f))!=EOF){
		if(a!=0.0){
		  y=(f-c*d/a)/(e-b*d/a);
		  x=(c-b*y)/a;
		}
		else if(d!=0.0 && b!=0.0){
		  y=c/b;
		  x=(f-e*y)/d;
		}
		else if(d==0.0){
		  x=0.0;
		  if(b!=0.0) y=c/b;
		  else if(e!=0.0) y=f/e;
		}
		round3(x);
		round3(y);
		printf("%0.3f %0.3f\n", x, y);
	}
	return 0;
}

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

using namespace std;

int main(int argc, char *argv[]) {
  double a, b, c, d, e, f;
  vector<double> xy;

  while (true) {
    cin >> a >> b >> c >> d >> e >> f;
    if (cin.eof())
      break;
    a -= d * b / e;
    c -= f * b / e;
    double x = c / a;
    x = (int)(x * 100 + 0.5);
    x /= 100;
    double y = (f - d * x) / e;
    y = (int)(y * 100 + 0.5);
    y /= 100;
    xy.push_back(x);
    xy.push_back(y);
  }

  for (int i = 0; i < xy.size() / 2; i++)
    printf("%.3lf %.3lf\n", xy[i*2], xy[i*2+1]);
  return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <string>
#include <math.h>
#include <algorithm>
using namespace std;
int main(){
 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 = (a*f - d*c) / (e*a - b*d);

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

 return 0; 
}

C++: #include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
#define loop(i,x,n) for(int i=(x);i<(n);i++)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define mp make_pair
#define fir first
#define sec second
#define ub upper_bound
#define lb lower_bound
#define int long long
using namespace std;
const int MOD=1000000007;
const int INF=1000000009;

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

C++: #include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;
int main(void){
	long long a, b, c, d, e, f;
	long long p, q, r;
	long long x, y, z;
	for (; scanf("%lld %lld %lld %lld %lld %lld", &a, &b, &c, &d, &e, &f) !=EOF;){
		c = c * 1000;
		f = f * 1000;
		p = (a*e) - (d*b);
		q = (c*e) - (f*b);
		x = q / p;
		p = (b*d) - (e*a);
		q = (c*d) - (f*a);
		y = q / p;
		printf("%lld.", x / 1000);
		printf("%03lld\n", x % 1000);
		printf("%lld.", y / 1000);
		printf("%03lld\n", y % 1000);
	}

		return 0;
	}

C++: #include <iostream>
#include <stdio.h>

#define EPS (1e-10)

using namespace std;
//?
int main(void){
	double a,b,c,d,p,q;
	while(cin >> a >> b >> p >> c >> d >> q){
		double delta = a*d-b*c;
		double x,y;
		x = (d*p-b*q)/delta;
		y = (-c*p+a*q)/delta;
		printf("%.3f %.3f\n",x+EPS,y+EPS);
	}
	return 0;
}

C++: #include <iostream>
#include <math.h>
#include <cstdio>

using namespace std;

int fugo(double r) {
	return r < 0 ? -1 : 1;
}
double Abs(double r) {
	return r < 0 ? -r : r;
}

int main() {
	char s[1000];
	while (1) {
		string str;
		if ( !getline(cin, str) ) break;

		for (int i = 0; i < str.size(); ++i)
			s[i] = str[i];
		s[str.size()] = '\0';

		double a, b, c, d, e, f;
		sscanf(s, "%lf%lf%lf%lf%lf%lf", &a, &b, &c, &d, &e, &f);

		double A = a * e - b * d;
		double x = (c * e - b * f) / A;
		double y = (a * f - c * d) / A;

		x = fugo(x) * (int)(Abs(x) * 10000 + 5) / 10 / 1000.0;
		y = fugo(y) * (int)(Abs(y) * 10000 + 5) / 10 / 1000.0;

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

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

int det(int a00, int a01, int a10, int a11)
{
	return a00*a11 - a01*a10;
}

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