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 <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 = det(c, b, f, e) / det(a, b, d, e);
        auto x2 = det(a, c, d, f) / det(a, b, d, e);
        if (x1 == 0) {
            x1 = 0;
        }
        if (x2 == 0) {
            x2 = 0;
        }
        cout << setprecision(4) << fixed << x1 << ' ' << x2 << endl;
    }
}

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

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

C++: #include<iostream>
using namespace std;
int main(){
	double a[60000]={0};
	int i=0;
	while(cin>>a[i++]);
	int n=i-1;
	for(int j=0;j<n;j+=6){
		double x=0,y=0;
		if(a[j+3]!=0&&a[j]!=0){
			double k=a[j]/a[j+3];
			a[j+3]*=k,a[j+4]*=k,a[j+5]*=k;
			y=(a[j+2]-a[j+5])/(a[j+1]-a[j+4]);
			x=(a[j+2]-a[j+1]*y)/a[j];
		}else if(a[j]==0){
			y=a[j+2]/a[j+1];
			x=(a[j+5]-a[j+4]*y)/a[j+3];
		}else if(a[j+3]==0){
			y=a[j+5]/a[j+4];
			x=(a[j+2]-a[j+1]*y)/a[j];
		}
		cout<<x<<" "<<y<<endl;
	}
	return 0;
}

C++: 
#include<stdio.h>

int main (void){

    int num0[6];
    int num1[6];
    int i;
    double x0, y0;
    int x1, y1;

    for(i = 0;i < 6 ;i++){
        scanf("%d",&num0[i]);
    }

    for(i = 0; i < 3; i++){
        num1[i] = num0[i] * num0[3];
    }
    for(i = 3; i < 6; i++){
        num1[i] = num0[i] * num0[0];
    }

    y0 = (num1[2] - num1[5]) / (num1[1] - num1[4]);

    x0 = (num0[2] - num0[1] * y0) / num0[0];

    /*y1 = y0 * 1000;
    if(y1 % 10 >= 5){
        y1++;
        y0 = y1 / 1000;
    }

    x1 = x0 * 1000;
    if(x1 % 10 >= 5){
        x1++;
        x0 = x1 / 1000;
        printf("%f",x0);
    }*/

    printf("\t%.3f\n\t%.3f\n",x0 ,y0);


    return 0;
}

C++: #include <iostream>
#include <cstdio>
#define EPS 1e-10
using namespace std;

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

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

double x,y;
int a,b,c,d,e,f;
int sisya = 1000;


void setX() {
    int ae, bd, ce, bf;
    
    ae = a * e;
    bd = b * d;
    ce = c * e;
    bf = b * f;
    
    x = (ce - bf) / (ae - bd);
    x *= sisya;
    if(x > 0) x += 0.5;
    else x -= 0.5;
    x = int(x);
    x /= sisya;
}

void setY() {
    int ae, af, cd, bd;
    
    bd = b * d;
    ae = a * e;
    cd = c * d;
    af = a * f;
    
    y = (cd - af) / (bd - ae);
    y *= sisya;
    if(y > 0) y += 0.5;
    else y -= 0.5;
    y = int(y);
    y /= sisya;
    
}

int main(void) {
    
    while(cin >> a >> b >> c >> d >> e >> f) {
        setX();
        setY();
        cout << setprecision(3);
        cout << setiosflags(ios::fixed);
        cout << x << " " << y << endl;
    }
    return 0;
}

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

int main() {
  std::cin.tie(0);
  std::ios::sync_with_stdio(false);

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

  while (cin >> a, cin >> b, cin >> c, cin >> d, cin >> e, cin >> f) {
    printf("%.4f %.4f\n", -(c * e - f * b) / (a * e - d * b), (c * d - f * a) / (b * d - e * a));
  }

  return 0;
}

C++: int main(){
	float a,b,c,d,e,f,x,y;
	while(scanf("%f",&a)){
	scanf("%f%f%f%f%f",&b,&c,&d,&e,&f);
	x=(c*e-b*f)/(a*e-b*d);
	y=(c*d-a*f)/(b*d-a*e);
	printf("%.3f %.3f",x,y);
	std::cout<<std::endl;
	}
	return 0;
	}

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

C++: #include <iostream>
#include <cstdio>
#define N 2
using namespace std;

class Calc{
    private:
    double A[N][N+1];
    int i, j, k;
    double tmp;
    public:
    void setNum(double**);
    void calcSi();
    void printSi();
};

void Calc::setNum(double** A){
    for(i=0;i<N;i++){
        for(j=0;j<N+1;j++){
            this->A[i][j] = A[i][j];
        }
    }
}

void Calc::calcSi(){
    for(i=0;i<N-1;i++){
        for(j=i+1;j<N;j++){
            tmp = A[j][i] / A[i][i];
            for(k=i+1; k<=N; k++)
                A[j][k] -= A[i][k] * tmp;
        }
    }

    for(i=N-1; i>=0; i--){
        tmp = A[i][N];
        for(j=i+1;j<N;j++)
            tmp -= A[i][j] * A[j][N];
        A[i][N] = tmp / A[i][i];
    }
}

void Calc::printSi(){
    for(i=0;i<N;i++){
        printf("%.3f",A[i][N]);
        if(i != N) {
            cout << " ";
        }
    }
    cout << endl;
}

int main(void){
    Calc c;
    double A[N][N+1];
    while(cin >> A[0][0] >> A[0][1] >> A[0][2] >> A[1][0] >> A[1][1] >> A[1][2]){
        c.setNum(A);
        c.calcSi();
        c.printSi();
    }
    return 0;
}

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

using namespace std;

int main()
{
	double A, B, C, D, E, F, X, Y, G , H;

	while(cin >> A >> B >> C >> D >> E >> F)
	{
		X=(C*E-F*B)/(A*E-D*B);
		Y=(A*F-D*C)/(A*E-D*B);

		printf("%.3f %.3f\n",X,Y);
	}
	return 0;
}

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

double mround(double a){
	if(a<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];

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


	return 0;
}