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 <iomanip>
using namespace std;

void OutputSolution(int a, int b, int c, int d, int e, int f)
{
	double y = (a*f - c*d) / (a*e - b*d);
	double x = (c-b*y) / a;
//	if(x == -0) x = 0;
//	if(y == -0) y = 0;
	cout << fixed << setprecision(3) << x << ' ' << y << endl;
}

int main()
{
	while(true){
		int a, b, c, d, e, f;
		cin >> a >> b >> c >> d >> e >> f;
		if(cin.eof()) break;
		OutputSolution(a, b, c, d, e, f);
	}
	return 0;
}

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

using namespace std;

int main(){
	double a,b,c,d,e,f,x,y;
	while(cin.eof()==false){
//		break;
	a=10000;
	cin >> a >> b >> c >> d >> e >> f;
	if (a==10000){
		break;
	}

	double under = a*e-b*d;
	if(abs((c*e-b*f)/under)<0.0005){
		x=0;
	}
	else{
		x=(c*e-b*f)/under;
	}
	if(abs((a*f-c*d)/under)<0.0005){
		y=0;
	}
	else{
		y=(a*f-c*d)/under;
	}

//	cout << (c*e-b*f)/under << " " << (a*f-c*d)/under << endl;
	printf("%.3f %.3f\n",x,y);
	}
}

C++: 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 = (b*f - c*e) / (b*d - a*e);
      y = (c*d - a*f) / (b*d - a*e);
      if(abs(x) < 0.000001 && x < 0)
	x = 0.0;
      if(abs(y) < 0.000001 && y < 0)
	y = 0.0;
      printf("%.3f %.3f\n", x, y);
    }
  return 0;
}

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

int main(){
double a,b,c,d,e,f,a_,b_,c_,d_,e_,f_;
double x,y;
double in;
while (std::cin >>a>>b>>c>>d>>e>>f){
in = (a*e - b*d);
a_ = e/in;
b_ = -1*b/in;
d_ = -1*d/in;
e_ = a/in;
x = c * a_ + f*b_;
y = c*d_ + f*e_;
std::cout << std::setprecision(3) << std::fixed << x << ' ' << std::setprecision(3) << std::fixed <<  y << std::endl;
}
    return 0;
}

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

using namespace std;

int main(){
  double a,b,c,d,e,f;
  vector<double> al,bl,cl,dl,el,fl;
  double x,y,n,m;

  while(cin >> a >> b >> c >> d >> e >> f){
    al.push_back(a);
    bl.push_back(b);
    cl.push_back(c);
    dl.push_back(d);
    el.push_back(e);
    fl.push_back(f);
  }

  for(int i=0; i<al.size(); i++){
    n = bl[i]/el[i];
    m = al[i]/dl[i];
    x = (cl[i]-n*fl[i])/(al[i]-n*dl[i]); 
    y = (cl[i]-m*fl[i])/(bl[i]-m*el[i]);
    printf("%0.3f %0.3f\n", x, y);
  }

  return 0;
}

C++: //
//  main.cpp
//  b
//
//  Created by h3037178 on 2017/07/31.
//  Copyright ?? 2017??´ ?????£?????????. All rights reserved.
//

#include <iostream>
#include<algorithm>
#include<math.h>
#include<stdio.h>
using namespace std;
int main(){
    float a,b,c,d,e,f,x,y;
    while(cin>>a>>b>>c>>d>>e>>f){
        x=(c*e-f*b)/(a*e-b*d);
        y=(c*d-f*a)/(b*d-a*e);
    }
    printf("%.3f %.3f\n",x,y);

}

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

using namespace std;


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

	while(scanf("%lld %lld %lld %lld %lld %lld",&a,&b,&c,&d,&e,&f)!=EOF){
		if(c*e==b*f){
			x=0;
		}else{
			pre_x=(10000*(c*e-b*f))/(a*e-d*b);

			if(pre_x>0 && ((pre_x%10) >= 5)){
				pre_x += (10-(pre_x%10));
			}else if(pre_x < 0 && ((pre_x%10) <= -5)){
				pre_x -= (10+(pre_x%10));
			}
			x = pre_x/10000;
			if(x < 0.001 && x > -0.001)x=0;
		}

		if(a*f==c*d){
			y=0;
		}else{
			pre_y=(10000*(a*f-c*d))/(a*e-b*d);
			if(pre_y>0 && ((pre_y%10) >= 5)){
				pre_y += (10-(pre_y%10));
			}else if(pre_y < 0 && ((pre_y%10) <= -5)){
				pre_y -= (10+(pre_y%10));
			}
			y = pre_y/10000;
			if(y < 0.001 && y > -0.001)y=0;
		}

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

    return 0;
}

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

using namespace std;

double a,b,c,d,e,f;

int main(){
	while(cin >> a >> b >> c >> d >> e >> f){
		printf("%8.3lf ",(c/a)-((b*c*d-a*b*f)/(a*b*d-a*a*e)));

		printf("%8.3lf\n",(c*d-a*f)/(b*d-a*e));
	}
    return 0;
}

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

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;
    if (abs(x) < 0.0001) x = 0;
    if (abs(y) < 0.0001) y = 0;
    x = double(round(x * 1000)) / 1000;
    y = double(round(y * 1000)) / 1000;
    printf("%.3f %.3f\n", x, y);
  }
  return 0;
}

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

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

	while (1) {
		cin>>a>>b>>c>>d>>e>>f;
		if (cin.eof()) break;

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

		cout<<setprecision(3)<<setiosflags(ios::fixed)<<x<<" "<<y<<endl;
	}

	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){
 y=(c*d-f*a)/(b*d-e*a);
 x=(c-b*y)/a;
 printf("%.3f %.3f\n",x,y);
 }
return 0;}

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

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

C++: #include <iostream>
#include <cmath>
#include <iomanip>

#define ROUND_RANK 4

//ax+by=c
//dx+ey=f

//行列式の算出
double Calc_det(const double& p11, const double& p12, const double& p21, const double& p22) {
	return (p11*p22 - p12*p21);
}
//xの解の算出
double Calc_x(const double& det, const double& q1, const double& p22, const double& p12, const double& q2) {
	return ((q1*p22 - p12*q2) / det);
}
//yの解の算出
double Calc_y(const double& det, const double& q2, const double& p11, const double& q1, const double& p21) {
	return ((q2*p11 - p21*q1) / det);
}
//少数点以下第rank位で四捨五入
double Round(const double& value, const int& rank) {
	int root = pow(10, rank);
	return (std::round(value*root) / root);
}

int main() {
	double	a, b, c, d, e, f;//データセット
	double  det;//行列式
	double	x, y;//解
	while (std::cin >> a >> b >> c >> d >> e >> f) {
		det = Calc_det(a, b, d, e);
		det = fabs(det);
		x = Calc_x(det, c, e, b, f);
		y = Calc_y(det, a, f, c, d);
		x = Round(x, ROUND_RANK);
		y = Round(y, ROUND_RANK);
		std::cout << std::fixed;
		std::cout << std::setprecision(3) << x << " " << y;
	}	
}

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){
		x = (e*c-b*f) / (a*e-d*b);
		y = (d*c-a*f) / (b*d-e*a);
		if(x==0) x=0;
		if(y==0) y=0;
		printf("%.3f %.3f\n",x,y);
	}	

	return 0;
}