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 <cstdio>
#include <cmath>
using namespace std;
int main() {
  int a, b, c, d, e, f;
  double x, y;
  while (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\n", round(x * 1000.0) / 1000.0, round(y * 1000.0) / 1000.0);
  }
  return 0;
}

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

#define doubled( x ) (x * x)

//?????????????¨????(2 * 2??£?????????)
int matrix_val(int a11, int a12, int a21, int a22);

//?????°?????°?????? (in:??´??° out:?????°)
int digit_count(int num);

using namespace std;

int main()
{
	int a, b, c, d, e, f;
	
	cin >> a >> b >> c ;
	cin >> d >> e >> f;
	do
	{
		int ans_x = matrix_val(c, b, f, e) / matrix_val(a, b, d, e);
		int ans_y = matrix_val(a, c, d, f) / matrix_val(a, b, d, e);
		
		cout << ans_x << ans_y << endl;
	}while( (cin >> a >> b >> c >> d >> e >> f) );
	
	return 0;
}

int matrix_val(
int a11, int a12,
int a21, int a22
){
	return ((a11 * a22) - (a12 * a21));
}

int digit_count(int num)
{
	if( num < 0 )num *= (-1);
	
	int count = 0;
	
	for(int i = 10; num != 0; i *= 10)
	{
		int diff = num % i;
		num -= diff;
		count++;
	}
		
	return count;
}

C++: #include <cmath>
#include <iomanip>
#include <ios>
#include <iostream>
#include <sstream>
#include <string>

using namespace std;

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

        auto det = [](int a00, int a01, int a10, int a11) -> double {
            return a00 * a11 - a01 * a10;
        };

        auto x1 = round(det(c, b, f, e) / det(a, b, d, e) * 1000.0) / 1000.0;
        auto x2 = round(det(a, c, d, f) / det(a, b, d, e) * 1000.0) / 1000.0;
        if (x1 == 0.0) {
            x1 = 0.0;
        }
        if (x2 == 0.0) {
            x2 = 0.0;
        }
        //stringstream tmp;
        //tmp << setprecision(4) << fixed << x1 << ' ' << x2 << endl;
        //double o1, o2;
        //tmp >> o1 >> o2;
        cout << setprecision(4) << fixed << x1 << ' ' << x2 << endl;
    }
}

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);
        if(x<-0.0005){
            x=0.000;
        }
        if(y<-0.0005){
            y=0.000;
        }
        printf("%.3f %.3f\n",x,y);
    }
}

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

double round(double src,int n);

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

    while(cin>>a>>b>>c>>d>>e>>f){
        double x = (b*f-c*e)/(b*d-a*e);
        double y = (a*f-c*d)/(a*e-b*d);
        x = round(x,4);
        y = round(y,4);

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

double round(double src,int n){
    double p = src * pow(10,n-1);
    p = floor(p+0.5);
    p = p * pow(10,-(n-1));
    return p;
    
}

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

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

double x(double, double, double, double, double, double) {

	return (c*e - b*f) / (a*e - b*d);
}

double y(double, double, double, double, double, double) {

	return (a*f - c*d) / (a*e - b*d);
}

double round(double dat, int keta){
	int fct;

	fct = (int)pow(10, keta - 1);
	dat *= fct;
	dat += (dat < 0) ? -0.5 : 0.5;
	dat = (int)(dat);
	dat /= fct;
	return dat;
}

int main()
{
	double x1, x2, y1, y2;
	cin >> a >> b >> c >> d >> e >> f;

	x1 = x(a, b, c, d, e, f);
	y1 = y(a, b, c, d, e, f);

	cin >> a >> b >> c >> d >> e >> f;

	x2 = x(a, b, c, d, e, f);
	y2 = y(a, b, c, d, e, f);

	cout << fixed << setprecision(3) << round(x1,3) << " " << round(y1,3) << endl;
	cout << fixed << setprecision(3) << round(x2,3) << " " << round(y2,3) << endl;

	return 0;
}

C++: #include<stdio.h>

int main(){
	double x1,y1,z1,x2,y2,z2,num1=0,x=0,y=0,z=0,sum1=0,sum2=0,vx=0,vy=0,vz=0;
	
	while(scanf("%lf %lf %lf %lf %lf %lf",&x1,&y1,&z1,&x2,&y2,&z2)!=EOF){
	
	
	
	
	
	if((x1>0&&x2>0)||(x1<0&&x2>0)){
		num1=x2/x1*-1;
	}
	else if((x1>0&&x2<0)||(x1<0&&x2<0)){
		num1=x2/x1;
	}
	
	
	
	vx=x1*num1;
	vy=y1*num1;
	vz=z1*num1;
	
	x=vx+x2;
	y=vy+y2;
	z=vz+z2;
		
	sum2=z/y;
	sum1=(z2-y2*sum2)/x2;
	
	
	
	
	if(sum1>=0){
	sum1=(int)(sum1*1000+0.5);
	sum1=(double)(sum1/1000);
	}
		else if(sum1<0){
	sum1=(int)(sum1*1000-0.5);
	sum1=(double)(sum1/1000);
	}
	if(sum2>=0){
	sum2=(int)(sum2*1000+0.5);
	sum2=(double)(sum2/1000);
	}
		else if(sum2<0){
	sum2=(int)(sum2*1000-0.5);
	sum2=(double)(sum2/1000);
	}
	
	
	
	printf("%.3f %.3f\n",sum1,sum2);
	
	}
		
	return 0;
}

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

C++: #include<stdio.h>
long int a,b, c, d, e, f;
int main()
{
while(scanf("%d",&a)!=EOF)
	{
		double x,y;
		scanf("%d %d %d %d %d",&b,&c,&d,&e,&f);
		x=(e*c-b*f)/(e*a-b*d);
		y=(c-a*x)/b;
		x = 1.23456;
		int temp=x*10000;
		if(temp % 10>=5)
			x+=0.001;
		temp = y*10000;
		if(temp % 10>=5)
			y+=0.001;
		printf("%f %f\n",x,y);
	}
}

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

using namespace std;

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

C++: #include <conio.h>
#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)
	{
		-1000 <= a, b, c, d, e, f <= 1000;
		x= (c*e-b*f)/(a*e-b*d);
		y= (c*d-a*f)/(b*d-a*e);
		if(x == -0.00){x=0.00;}
		if(y == -0.00){y=0.00;}
		cout<<setprecision(3)<<fixed;
		cout<<x<<" "<<y<<endl;
	}
        cin.get();
        getch();
	return 0;
}