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<cstdio>
#include<cstring>

using namespace std;

int main(){
   double a,b,c,d,e,f;
   double x,y;
   int X,Y;
   
   while(cin>>a>>b>>c>>d>>e>>f){
      x = (c*e-b*f)/(a*e-b*d);
      y = (c*d-a*f)/(b*d-a*e);
      
      X = static_cast<int>(x*10000);
      if(X%10>=5){
         X += 10 - (X%5);
         x = static_cast<double>(X /10000);
      }
      Y = static_cast<int>(y*10000);
      if(Y%10>=5){
         Y += 10 - (Y%5);
         y = static_cast<double>(Y /10000);
      }
      if(0 == static_cast<int>(x))
         x = 0;
      if(0 == static_cast<int>(y))
         y = 0;
      
      printf("%.3lf %.3lf\n",x,y);
      
   }
   return 0;
}

C++: 
def ans(a, b, c, d, e, f):
    x = ((e*c - b*f)/(a*e-b*d))
    y = ((-d*x + f)/e)
    x = "%.3f" % x
    y = "%.3f" % y
    return x, y


sets = []

while True:
    try:
        line = list(map(int, input().split()))
        if(line[0] == " "):
            break;
        else:
            sets.append(line)
    except IndexError:
        break

for i in sets:
    x, y = ans(i[0],i[1],i[2],i[3],i[4],i[5])
    print(x, y)

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

using namespace std;

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 = (int)(x * 10000 + 5) / 10 / 1000.0;
		y = (int)(y * 10000 + 5) / 10 / 1000.0;

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

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

using namespace std;

/*
aX+bY=c
dX+eY=f
*/

void solve(int a, int b, int c, int d, int e, int f) {
	double x = (f - e*c/b) / (d - e*c/b);
	double y = (c - a*x) / b;
	printf("%4.3f %4.3f\n", x, y);
}

int main() {
	int a, b, c, d, e, f;
	while (cin >> a >> b >> c >> d >> e >> f) {
		solve(a,b,c,d,e,f);
	}
	return 0;
}

C++: #include <cstdio>

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

	while(scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f)!=EOF){
		g=a*e-b*d;
		printf("%lf %lf\n",(e*c+(-b)*f)/d,((-d)*c+a*f)/d);
	}
	return 0;
}

C++: #include <iomanip>
#include <iostream>
#include <vector>
#define N 2
 
using namespace std;
typedef vector< vector<double> > Equation;
 
bool input(Equation& c)
{
	if (!cin) return false;

    for (int i = 0; i < N; ++i)
        for (int j = 0; j < N + 1; ++j)
            cin >> c[i][j];
 
    return true;
}
 
int main()
{ 
    Equation c(N, vector<double>(N + 1));
	while (!cin.eof())
	{
		for (int i = 0; i < N; ++i)
			for (int j = 0; j < N + 1; ++j)
				cin >> c[i][j];

		// Gaussian elimination
		// 1. Forward elimination
        for (int i = 0; i < N - 1; ++i)
            for (int j = i + 1; j < N; ++j)
            {
                double d = c[j][i] / c[i][i];
                for (int k = i + 1; k <= N; ++k)
                    c[j][k] -= c[i][k] * d;
            }
 
		// 2. Back substitution
        for (int i = N - 1; i >= 0; --i)
        {
            double d = c[i][N];
            for (int j = i + 1; j < N; ++j)
                d -= c[i][j] * c[j][N];
            c[i][N] = d / c[i][i];
        }
 
        cout << setprecision(4) << fixed << c[0][N];
        for (int i = 1; i < N; ++i)
            cout << " " << c[i][N];
        cout << endl;
    }
 
    return 0;
}

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

int main(void) {
    int a, b, c, d, e, f;
    float x, y;
    float det;
    while(cin >> a >> b >> c >> d >> e >> f) {
        det = a * e - b * d;
        x = (float)(e * c - b * f) / det;
        y = (float)(-d * c + a * f) / det;
        x = roundf(1000 * x) / 1000;
        y = roundf(1000 * y) / 1000;
        printf("%.3f %.3f\n", x, y);
    }
}

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

int main() {
	vector<int> a(1), b(1), c(1), d(1), e(1), f(1);
	int cnt=0;
	while(cin >> a[cnt] >> b[cnt] >> c[cnt] >> d[cnt] >> e[cnt] >> f[cnt]) {
		cnt++;
		a.push_back(0);
		b.push_back(0);
		c.push_back(0);
		d.push_back(0);
		e.push_back(0);
		f.push_back(0);
	}
	a.pop_back();
	b.pop_back();
	c.pop_back();
	d.pop_back();
	e.pop_back();
	f.pop_back();

	vector<double> x(a.size()), y(a.size());

	for(int i=0; i<a.size(); i++) {
		y[i] = (a[i]*f[i]-c[i]*d[i])/(a[i]*e[i]-b[i]*d[i]);
		x[i] = (c[i]-b[i]*y[i])/a[i];
	}
	for(int i=0; i<a.size(); i++) cout << fixed << setprecision(3) << x[i] << " " << y[i] << endl;
	return 0;
}

C++: #include<stdio.h>
void main()
{
  float a,b,c,d,e,f;
  float x,y;
  scanf("%f%f%f%f%f%f",&a,&b,&c,&d,&e,&f);
  y=(c*d-a*f)/(b*d-a*e);
  x=(c-b*y)/a;
  printf("x=%f,y=%f",x,y);
}

C++: #include<iostream>
#include<stdio.h>
using namespace std;
int main(){
	double a,b,c,d,e,f,x,y;
	while(cin>>a>>b>>c>>d>>e>>f){
		y=(d*c-f*a)/(b*d-e*a);
		x=(c-b*y)/a;
		//cout<<x<<" "<<y<<endl;
		printf("%.3f %.2f%d",x,y);
	}
}

C++: #include <iostream>
#include <iomanip>
using namespace std;
int main(){
    double a,b,c,d,e,f;

    while (!cin.eof()){
        cin>>a>>b>>c>>d>>e>>f;
        double D=a*e-b*d;
        double X=(c*e-f*b)/D,Y=(a*f-d*c)/D;
        cout << setprecision(3)<<fixed;
        cout<<setprecision(3)<<X<<" "<<Y<<endl;

    }
    return 0;
}

C++: #include<stdio.h>
#include<stdlib.h>
int main()
{
    int a,b,c,d,e,f;
    double l,k;
    while (scanf ("%d %d %d %d %d %d", &a,&b,&c,&d,&e,&f) != EOF){
        l= a*e-d*b;
        k = b*d - a*e;
        double x = (c*e-b*f)/l;
        double y =(c*d - a*f)/k;

        /*if(x ==0)
            x = abs(x);
        if(y == 0)
            y = abs(y);*/

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

C++: #include<iostream>
#include<stdio.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 = ((e*c-b*f) / (a*e - b*d));
                y = ((-(d*c) + a*f) / (a*e - b*d));


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

        }

        return 0;
}

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

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

  while(cin>>a>>b>>c>>d>>e>>f){

  m = a;
  n = d; 

  a *= n;
  b *= n;
  c *= n;

  d *= m;
  e *= m;
  f *= m;
  
  y = (c-f)/(b-e);

  x = (c-b*y)/a;

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

  return 0;
}

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

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

int main(void)
{
	while( std::cin >> a >> b >> c >> d >> e >> f ){
		y = ( a * f - c * d ) / ( a * e - b * d );
		printf("%.3f %.3f\n", ( c - b * y ) / a, y );
	}

	return 0;
}