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

int main()
{
	double a[6], x, y;

	while(cin>>a[0]){
		for(int i = 1; i < 6; i++){
			cin>>a[i];
		}
		y = (a[2]*a[3]-a[0]*a[5])/(a[1]*a[3]-a[0]*a[4]);
		x = (a[2]-a[1]*y)/a[0];


		if(x >= 0) x = ((double)((int)(x*1000+0.5)))/1000;
		else x = ((double)((int)(x*1000-0.5)))/1000;
		if(y >= 0) y = ((double)((int)(y*1000+0.5)))/1000;
		else y = ((double)((int)(y*1000-0.5)))/1000;

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

C++: #include <bits/stdc++.h>
//#include "bits/stdc++.h"

#define rep(i,n) for(ll (i)=0;(i)<(ll)(n);(i)++)
#define all(x) (x).begin(),(x).end()
#define MOD 1000000007LL
#define INF (1LL<<60LL)
#define int long long
typedef long long ll;

using namespace std;



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

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


int main () {

	double a,b,c,d,e,f;
	double x,y;
	
	while(cin>>a>>b>>c>>d>>e>>f){
	double ta=a;
	double tb=b;
	double tc=c;
	
	a*=d;
	b*=d;
	c*=d;
	d*=ta;
	e*=ta;
	f*=ta;
	if((b-d)==0)
		y=0;
	else{
		y=(c-f)/(b-e);
	}
	x=(tc-(tb*y))/ta;

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

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

using namespace std;

int main(){
  double a,b,c,d,e,f;
  vector<double> out;
  while (cin>>a>>b>>c>>d>>e>>f){
    out.push_back((c*e-b*f)/(a*e-b*d));
    out.push_back((c*d-a*f)/(b*d-a*e));
  }
  for (int i=0;i<out.size();i+=2){
    if (out[i]==0) out[i]=0;
    if (out[i+1]==0) out[i+1]=0;
    printf("%.3f %.3f\n",round(out[i]*1000)/1000.0,round(out[i+1]*1000)/1000.0);
  }
  return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

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

C++: 
#include<stdio.h>

int main (void){

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

    double X,Y;

    while(scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f) != EOF){

        Y = (c*d-f*a)/(b*d-e*a);

        X = (c*e-f*b)/(a*e-d*b);

        printf("%.3lf %.3lf\n",X ,Y);
    }

    return 0;
}

C++: #include <stdio.h>

using namespace std;


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

	while(scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f)!=EOF){
		if(c*e==b*f){
			x=0;
		}else{
			x=(c*e-b*f)/(a*e-d*b);
		}

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

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

    return 0;
}

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

using namespace std;

int main()
{
    float a,b,c,d,e,f,x,y;
    while(cin>>a>>b>>c>>d>>e>>f){
       x=(c*e-f*b)/(a*e-b*d);
       y=(a*f-d*c)/(a*e-b*d);
       cout<<x<<" "<<y<<endl;                          
    }
}

C++: #include <iostream>
#include <cstdio>
#include <cmath>
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 = (c*d - a*f)/(b*d - a*e);
  
      if(abs(x) < 0.001) x = 0;
      if(abs(y) < 0.001) y = 0;
      printf("%.3f %.3f",x,y);
      
    }
    return 0;
}

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

#define REP(i,n) for(int i=0;i<(int)(n);++i)

int main() {
  for(;;) {
    double a, b, c, d, e, f;
    if( !(cin >> a >> b >> c >> d >> e >> f) )break;
    double det = 1.0 / (-b * d + a * e);
    double x = det * (e * c - b * f);
    double y = det * (-d * c + a * f);
    if( x > y ) swap( x, y );
    double EPS = 1e-8;
    printf("%.3f %.3f\n", x + EPS, y + EPS);
    
  }
  return 0;
}

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

int main(){

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

    return 0;
}

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

int main()
{
  int a, b, c, d, e, f;
  while (scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f) != EOF) {
    float x, y;
    float gy = (a * e) - (b * d);
    swap(a, e);
    b *= -1;
    d *= -1;
    x = (a * c) + (b * f);
    y = (d * c) + (e * f);
    x /= gy;
    y /= gy;
    if (x == 0) x = abs(x);
    if (y == 0) y = abs(y);
    printf("%.3f %.3f\n", x, y);
  }
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main(){
	double a,b,c,d,e,f,g;
	while(cin>>a>>b>>c>>d>>e>>f){
		g=a;
		a*=d;
		b*=d;
		c*=d;
		d*=g;
		e*=g;
		f*=g;
		if(a==d){
			a-=d;
			b-=e;
			c-=f;
		}else{
			a+=d;
			b+=e;
			c+=f;
		}
		c/=b;
		e*=c;
		f-=e;
		f/=d;
		printf("%.3f %.3f\n",f,c);
	}
}

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

int main(void){
	double a,b,c,d,e,f;
	//int X[2][2]={ {c,b}, {f,e} };
	//int Y[2][2]={ {a,c}, {d,f} };
	double x,y;
	double A,X,Y;
	while(cin>>a>>b>>c>>d>>e>>f){
		A=a*e-b*d;
		X=c*e-b*f;
		Y=a*f-c*d;
		x=(1/A)*X;
		y=(1/A)*Y;
		cout << fixed << setprecision(3) << x << ' ' << y << endl;
	}
	
	return 0;
}

C++: #include<stdio.h>

int main(void){
	double x=0,y=0;
	int a=0,b=0,c=0,d=0,e=0,f=0,i=0,j;
    
    while(scanf("%d %d %d %d %d %d\n",&a,&b,&c,&d,&e,&f) != EOF)
	{
		y = ( c * d - a * f ) / ( b * d - e * a );

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

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

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

int main(void) {
	int a, b, c, d, e, f;
	double x, y;
	while (scanf("%d%d%d%d%d%d", &a, &b, &c, &d, &e, &f) != EOF) {
		x = (double)(c*e - b*f) / (a*e - b*d);
		y = (double)(c*d - a*f) / (b*d - a*e);
		if (fabs(x) < 1e-3) x = 0;
		if (fabs(y) < 1e-3) y = 0;

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

C++: #include<cstdio>
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<string>
#include<functional>
#include<queue>
#include<math.h>
#define INF 999999

using namespace std;


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

	vector<pair<double,double>> ans;
	while (cin >> a >> b >> c >> d >> e >> f) {

		double x = (e*c - b*f) / (e*a - b*d);
		double y = (d*c - a*f) / (d*b - a*e);

		ans.push_back(make_pair(x, y));

	}

	for (int i = 0; i < ans.size(); i++) {
		printf("%.3f %.3f\n", ans[i].first, ans[i].second);
	}

	return 0;
}