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 <iomanip>
#include <cstdio>
#include <cmath>
#include <utility>
using namespace std;
typedef pair<double, double> PDD;
PDD calc(double mat[2][2], double vec[2]){
  double a = mat[0][0], b = mat[0][1], d = mat[1][0], e = mat[1][1];
  double c = vec[0], f = vec[1];
  double det = a * e - d * b;
  return make_pair((e * c - b * f) / det, (-c * d + a * f) / det);
}
int main(){
  double mat[2][2];
  double vec[2];
  while(cin >> mat[0][0] >> mat[0][1] >> vec[0] >> mat[1][0] >> mat[1][1] >> vec[1]){
    PDD res = calc(mat, vec);
    double x = (double)(round(res.first*1000))/1000.0, y = (double)(round(res.second*1000))/1000.0;
    x = (x == -0.0) ? 0.0 : x;
    y = (y == -0.0) ? 0.0 : y;
    printf("%.3f %.3f\n", x, y);
  }
  return 0;
}

C++: #include<stdio.h>

void printFunc(int a,int b,int c,int d,int e,int f);

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

  while(scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f) != EOF){
    int pa = a,pb = b,pc = c,pd = d,pe = e,pf = f;   
    printFunc(a,b,c,d,e,f);
  }
  
  return 0;
}

void printFunc(int a,int b,int c,int d,int e,int f){
  float ansX,ansY;
  if(b == 0 || e == 0){
    ansY = 0;
  }
  else{
    ansY = (float)(c*d - f*a)/(float)(b*d - e*a);
  }

  if(a == 0 || d == 0){
    ansX = 0;
  }
  else{
    ansX = (float)(c*e - f*b)/(float)(a*e - d*b);
  }

  if(ansX < 0.0005f){
    ansX = 0.0f;
  }
  if(ansY < 0.0005f){
    ansY = 0.0f;
  }

  printf("%.3f %.3f\n",ansX,ansY);
}

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

using namespace std;

int main(){
	double a,b,c,d,e,f,x,y;
	cin>>a>>b>>c>>d>>e>>f;
	y=(double)(d*c-a*f)/(a*b-a*e);
	x=(double)((e*c-b*f)/(e*a-d*b));
	if(x == 0){x = 0;}
    if(y == 0){y = 0;}
	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 = (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);
 }
}

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 - (double)e*c/b) / (d - (double)e*a/b);
	double y = ((double)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 <iostream>
#include <stdio.h>
int main()
{
    double a , b , c , d , e , f ;
    while ( std :: cin >> a >> b >> c >> d >> e >> f )
    {
        printf ("%.3lf %.3lf\n" , ( a*e*c - b*a*f ) / ( a*a*e - a*b*d ) , ( a*f - d*c ) / ( a*e - b*d ) ) ;
        //std :: cout << ( a*e*c - b*a*f ) / ( a*a*e - a*b*d ) << ' ' << ( a*f - d*c ) / ( a*e - b*d ) << std :: 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) {
    x = (c*e-b*f)/(a*e-b*d);
    y = (a*f-c*d)/(a*e-b*d);
    cout << "[1] [2]" << fixed << setprecision(3) << x << y << endl;
  }
}

C++: #include<stdio.h>
int main(void){
        float a,b,c,d,e,f,x,y;
        while(scanf("%f %f %f %f %f %f",&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(x==0){
                        x=x*(-1);
                }
                if(y==0){
                        y=y*(-1);
                }
                printf("%.3f %.3f\n",x,y);
        }
        return 0;
}

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

using namespace std;

int main(void)
{
	double a,b,c;
	double d,e,f;
	double delta;
	double delta_one;
	double delta_two;
	double x,y;
	
	while( scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f) != EOF)
	{
		delta = (a*e) -(b*d);
		delta_one  = (c*e) - (f*b);
		delta_two = (a*f) - (c*d);
		x = delta_one/delta;
		y = delta_two/delta;
		x = x * 1000;
		y = y * 1000;
		x = (int)x;
		y = (int)y;
		x = x/1000;
		y = y/1000;

		printf("%0.3lf %0.3lf\n",x,y);	
	}
	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){
    y = (a*f-d*c) / (a*e - b*d);
    x = (c-b*y) / a;
    cout << setprecision(3) << setiosflags(ios::fixed) << x << ' ' << setprecision(3) << setiosflags(ios::fixed) << y << endl;
  }
  return 0;
}

C++: #include <stdio.h>

int main(void){

    float a,b,c,d,e,f;
    float x,y;
    float tmp1,tmp2;
    
    while(1){
        a = 2000;
        scanf("%.3f %.3f %.3f %.3f %.3f %.3f", &a, &b, &c, &d, &e, &f);
        if(a == 2000)break;
    
        tmp1 = c*e - b*f;
        tmp2 = a*e - b*d;
        x = tmp1 / tmp2;
        tmp1 = a*f - c*d;
        tmp2 = a*e - b*d;
        y = tmp1 / tmp2;
        printf("%.3f %.3f\n", x, y);
    }
    
    return 0;
}

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

using namespace std;

int main()
{
	double a, b, c, d, e, f;
	cout << setprecision(3);
	cout << fixed;
	while (cin >> a >> b >> c >> d >> e >> f){
		double x = (c * e - b * f) / (a * e - b * d);
		double y = (c * d - a * f) / (b * d - a * e);
		int lastx = int(x * 10000) % 10;
		int lasty = int(y * 10000) % 10;
		if (lastx >= 5){
			x += 0.001;
		}
		if (lasty >= 5){
			y += 0.001;
		}
		cout << x << " " << y << endl;
	}
	return 0;
}

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

int main(){
  double a,b,c,d,e,f,answer1,answer2;
  while(cin >> a>>b>>c>>d>>e>>f){
    answer1=(e*c-b*f)/(e*a-b*d);
    answer2=(c*d-a*f)/(d*b-a*e);
    if(answer1==-0.000){
      answer1=0.000;
    }
      if(answer2==-0.000){
      answer1=0.000;
    }
    
    cout << fixed << setprecision(3) << answer1<<" "<<answer2 << endl; 
  }

    return 0;
}

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

int main() {
	int cnt = 0;
	int a[200], b[200], c[200], d[200], e[200], f[200];
	double x[200], y[200];

	while(cin >> a[cnt] >> b[cnt] >> c[cnt] >> d[cnt] >> e[cnt] >> f[cnt]) cnt++;

	for(int i=0; i<cnt; i++) {
		if(a[i] != 0 && b[i] != 0 && d[i] != 0 && e[i] != 0) {
			x[i] = (b[i]*f[i]-e[i]*c[i])/(b[i]*d[i]-a[i]*e[i]);
			y[i] = (d[i]*c[i]-a[i]*f[i])/(b[i]*d[i]-a[i]*e[i]);
		} else {
			if(a[i] == 0) {
				y[i] = c[i]/b[i];
				x[i] = (f[i]-e[i]*y[i])/d[i];
			} else if(b[i] == 0) {
				x[i] = c[i]/a[i];
				y[i] = (f[i]-d[i]*x[i])/e[i];
			} else if(d[i] == 0) {
				y[i] = f[i]/e[i];
				x[i] = (c[i]-b[i]*y[i])/a[i];
			} else if(e[i] == 0) {
				x[i] = f[i]/d[i];
				y[i] = (c[i]-a[i]*x[i])/b[i];
			}
		}
	}

	for(int i=0; i<cnt; i++) cout << fixed << setprecision(3) << x[i] << " " << y[i] << endl;

	return 0;
}