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<cstdio>
#include<iostream>
using namespace std;

int gcm(int a,int b){
	int c=a%b;
	while(c!=0){
		a=b;
		b=c;
		c=a%b;
        }
	return b;
}

int main(){
	int x[2],y[3],sum[3];
	double ans[2];
	while(cin>>x[0]>>y[0]>>sum[0]>>x[1]>>y[1]>>sum[1]){
		if(x[0]==0){
			ans[1]=(double)sum[0]/y[0];
			ans[0]=(sum[1]-y[1]*ans[1])/x[1];
		}else if(x[1]==0){
			ans[1]=(double)sum[1]/y[1];
			ans[0]=(sum[0]-y[0]*ans[1])/x[0];
		}else if(y[0]==0){
			ans[0]=(double)sum[0]/x[0];
			ans[1]=(sum[1]-x[1]*ans[0])/y[1];
		}else if(y[1]==0){
			ans[0]=(double)sum[1]/x[1];
			ans[1]=(sum[0]-x[0]*ans[0])/y[0];
		}else{
			y[2]=y[0]*x[1]-y[1]*x[0];
			sum[2]=sum[0]*x[1]-sum[1]*x[0];
			ans[1]=(double)sum[2]/y[2];
			ans[0]=(sum[0]-y[0]*ans[1])/x[0];
		}
		printf("%.3f %.3f\n",ans[0],ans[1]);
	}
	return 0;
}

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

static double
round3(double r)
{
	r *= 1000.0;
	r = round(r);
	r /= 1000.0;
	
	if (r == -0) {
		r = 0;
	}
	
	return r;
}

int
main(void)
{
	char line[80];
	double a;
	double b;
	double c;
	double d;
	double e;
	double f;
	double x;
	double y;

	while (gets(line)) {
		if (sscanf(line, "%lf %lf %lf %lf %lf %lf",
				   &a, &b, &c, &d, &e, &f) == 6) {
			x = (e*c  -b*f)/(a*e - b*d);
			y = (d*c - a*f)/(d*b - a*e);
			
			printf("%.3f %.3f\n", round3(x), round3(y));
		}
	}

	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <cstring>
#include <climits>
#include <cmath>
#include <cfloat>

#define FOR(i,b,n) for(int i=b;i<n;i++)
#define CLR(mat) memset(mat, 0, sizeof(mat))
#define INF 1<<25

using namespace std;

double a,b,c,d,e,f,x,y;
double rmat[2][2];

int main()
{
	while( cin >> a >> b >> c >> d >> e >> f, !cin.eof())
	{
		double delta = 1/(a*e - b*d);

		rmat[0][0] = delta*e;
		rmat[0][1] = -delta*b;
		rmat[1][0] = -delta*d;
		rmat[1][1] = delta*a;


		x = c*rmat[0][0] + f*rmat[0][1];
		y = c*rmat[1][0] + f*rmat[1][1];

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

	}

	return 0;
}

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

int main(){
  int i;
  float x[6];

  while(cin >> x[0]){
    for(i=1; i<6; i++){
      cin >> x[i];
    }

    //normalize
    x[1]/=x[0]; x[2]/=x[1]; x[0]=1;

    //subtraction
    x[4]-=x[3]*x[1]; x[5]-=x[3]*x[2]; x[3]=0;

    //normalize
    x[5]/=x[4]; x[4]=1;

    //subtraction
    x[2]-=x[1]*x[5]; x[1]=0;

    printf("%f %f\n", x[2], x[5]);
  }

  return 0;
}

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

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

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

int main(){
	int x[2],y[3],sum[3];
	double ans[2];
	while(cin>>x[0]>>y[0]>>sum[0]>>x[1]>>y[1]>>sum[1]){
		if(x[0]==0){
			ans[1]=(double)sum[0]/y[0];
			ans[0]=(sum[1]-y[1]*ans[1])/x[1];
		}else if(x[1]==0){
			ans[1]=(double)sum[1]/y[1];
			ans[0]=(sum[0]-y[0]*ans[1])/x[0];
		}else if(y[0]==0){
			ans[0]=(double)sum[0]/x[0];
			ans[1]=(sum[1]-x[1]*ans[0])/y[1];
		}else if(y[1]==0){
			ans[0]=(double)sum[1]/x[1];
			ans[1]=(sum[0]-x[0]*ans[0])/y[0];
		}else{
			y[2]=y[0]*x[1]-y[1]*x[0];
			sum[2]=sum[0]*x[1]-sum[1]*x[0];
			ans[1]=(double)sum[2]/y[2];
			ans[0]=(sum[0]-y[0]*ans[1]);
		}
		printf("%.3f %.3f\n",ans[0],ans[1]);
	}
	return 0;
}

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

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

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

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

using namespace std;

int main()
{
	double a, b, c, d, e, f;
	cout << setprecision(3) << fixed;
	while (cin >> a >> b >> c >> d >> e >> f) {
		double denom = a * e - b * d;
		double x = (c * e - b * f) / denom;
		x = (x == -0) ? 0 : x;
		double y = (a * f - c * d) / denom;
		y = (y == -0) ? 0 : y;

		cout << x << ' ' << y << endl;
	}
	return 0;
}

C++: #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) {
		x = (c * e - b * f) / (a * e - b * d);
		y = (a * f - c * d) / (a * e - b * d);
		if ((int)(x * 1000) - x * 1000 >= 0.5) {
			x = ((int)(x * 1000 + 0.5)) / 1000;
		}
		else { x = ((int)(x * 1000)) / 1000; }
		if ((int)(y * 1000) - y * 1000 >= 0.5) {
			y = ((int)(y * 1000 + 0.5)) / 1000;
		}
		else { y = ((int)(y * 1000)) / 1000; }
		cout << fixed << setprecision(3) << x << " " << y << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<cmath>
#include<cstdio>
using namespace std;
int main(){
	double a,b,c,d,e,f,n[20];
	while(cin>>a>>b>>c>>d>>e>>f){
	double x,y;
	int w;
	if(a == 0){
		n[0] = 0;
		n[1] = 0;
	}else{
		n[0] = c / a;
		n[1] = b / a;
	}
	if(d == 0){
		n[2] = 0;
		n[3] = 0;
	}else{
		n[2] = f / d;
		n[3] = e / d;
	}
	if(b == 0){
		n[4] = 0;
		n[5] = 0;
	}else{
		n[4] = c / b;
		n[5] = a / b;
	}
	if(e == 0){
		n[6] = 0;
		n[7] = 0;
	}else{
		n[6] = f / e;
		n[7] = d / e;
	}
	if(n[1] - n[3] == 0){
		y = 0;
	}else{
		y = (n[0] - n[2]) / (n[1] - n[3]);
	}
	if(n[5] - n[7] == 0){
		x = 0;
	}else{
		x = (n[4] - n[6]) / (n[5] - n[7]);
	}
	x = x * pow(10, - 5);
	double xx = x + 0.5;
	xx = xx * pow(10,5);
	y = y * pow(10, - 5);
	double yy = y + 0.5;
	yy = yy * pow(10,5);

	printf("%04f,%04f\n",&xx,&yy);



}
return 0;
}

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

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

C++: #include<stdio.h>
float calcy(float,float,float,float,float,float);
float calcx(float,float,float,float);
int main(void)
{
	int a,b,c,d,e,f;
	float x,y;
	for(int i=0;i<2;i++){
		scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f);
		y=calcy(a,b,c,d,e,f);
		x=calcx(a,b,c,y);
		printf("%.3lf %.3lf\n",x,y);
	}
	return 0;
}
float calcy(float a,float b,float c,float d,float e,float f){
	float y;
	b=b/a*-1;
	c=c/a;
	b=d*b;
	c=d*c;
	e=b+e;
	f=f-c;
	y=f/e;
	return y;
}
float calcx(float a,float b,float c,float y){
	float x;
	b=b*y;
	c=c-b;
	x=c/a;
	return x;
}