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++: //#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
//#include <cstdlib>
#include <cmath>
#include <iostream>
#include <algorithm>
//#include <cstring>
#include <vector>
#include <string>
#include <map>
#include <list>
#include <queue>
#include <set>
using namespace std;

int main(void){

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

	return 0;
}

/*
for(i=0;i<N;i++){
	cin >> X[i];
}


for(i=0;i<N;i++){
	for(j=0;j<N;j++){
		cin >> X[i][j];
	}
}
*/

C++: #include <bits/stdc++.h>
using namespace std;

#define FOR(i,l,r) for(int i = (l);i < (r);i++)
#define ALL(x) (x).begin(),(x).end()
template<typename T> bool chmax(T& a,const T& b){return a < b ? (a = b,true) : false;}
template<typename T> bool chmin(T& a,const T& b){return b < a ? (a = b,true) : false;}
typedef long long ll;

double A,B,C,D,E,F;

int main()
{
	while(~scanf("%lf%lf%lf%lf%lf%lf",&A,&B,&C,&D,&E,&F)){
		double x,y;
		if(A == 0.0){
			y = C / B;
		}
		else if(D == 0.0){
			y = F / E;
		}
		else{
			E -= D / A * B;
			F -= D / A * C;
			D = 0.0;
			y = F / E;
		}
		if(A){
			x = (C - B * y) / A;
		}
		else{
			x = (F - E * y) / D;
		}
		printf("%.3f %.3f\n",x,y);
	}

	return 0;
}

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

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

using namespace std;

int main() {
    double a, b, c, d, e, f, x, y, det;
    while (true) {
        cin >> a >> b >> c >> d >> e >> f;
        if (cin.eof()) {
            return 0;
        }
        det = a*e-b*d;
        x = (c*e-b*f)/det;
        y = (a*f-c*d)/det;
        if (x < 0.0005) {
            x = 0;
        }
        if (y < 0.0005) {
            y = 0;
        }
        cout << std::fixed << setprecision(3) << x << ' ' << y << endl;
    }
}

C++: #include<bits/stdc++.h>
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)!=EOF){

    double det = (a*e) - (b*d);
    double xx = (c*e) - (b*f);
    double yy = (a*f) - (c*d);
    double x = xx/det;
    double y = yy/det;
    long long x0 = x , y0 = y;
    if(x0 == 0 ) x = 0.000;
    else if(y0 == 0) y = 0.000;
    printf("%.3lf %.3lf\n",x,y);
}
return 0;
}

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;
}