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 := float64(cF) / float64(bE)
		x := (float64(c) - (y * float64(b))) / float64(a)

		if x == 0 {
			fmt.Printf("%.3f ", 0.0)
		} else {
			fmt.Printf("%.3f ", x)
		}
		if y == 0 {
			fmt.Printf("%.3f\n", 0.0)
		} else {
			fmt.Printf("%.3f\n", y)
		}
	}
}

C++: #include<stdio.h>
#include<math.h>
int main(void){
    double a,b,c,d,e,f,A,x,y,X,Y,Z;

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

    Y=b*d-e*a,Z=c*d-f*a;
    y=Z/Y;

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

   printf("%.3lf %.3lf\n",x,y);
    }
   //printf("\na%lf\nb%lf\nc%lf\nd%lf\ne%lf\nf%lf\n%lf\n%lf",a,b,c,d,e,f,Y,Z);

    return 0;
}

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

using namespace std;


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

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

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

    while (cin >> a >> b >> c >> d >> e >> f) {
        det = a * e - b * d;
        det = 1.0 / det;
        x = det * (e * c - b * f);
        y = det * (a * f - c * d);

        if (x == 0)
            x = 0;
        if (y == 0)
            y = 0;
        cout << setprecision(3);
        cout << fixed;
        cout << x << ' ' << y << endl;
    }

    return 0;
}

C++: #include<iostream>
#include<string>
#include<cmath>
#include<cstdio>
#include<vector>
#include<stack>
#include<queue>
#include<algorithm>
#include<complex>
using namespace std ;
typedef vector<int> vi ;
typedef vector<vi> vvi ;
typedef vector<string> vs ;
typedef pair<int, int> pii; 
typedef long long ll ;

#define loop(i,a,b) for(int i = a ; i < b ; i ++)
#define rep(i,a) loop(i,0,a)
#define all(a) (a).begin(),(a).end()
#define EPS 1e-9

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

C++: /*
C++ ???????????????????????????????????¬??????
??????AOJ-ITP1??????????????????
*/

#define _USE_MATH_DEFINES

#include <iostream> // ?¨??????\??????
#include <fstream>  // ??????????????\??????
#include <string>   // ???????????¢???
#include <vector>   // ???????????????
#include <cmath>    // ??°??????
#include <iomanip>  // stream???????????¢???
#include <algorithm>// max??¢??°??????

using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::vector;        // ????´???°????????????????????????
using std::fixed;         // ???????????????????¨???????????????????????????????
using std::setprecision;  // ?????°????°???°?????\???????????°????????????????????¨????????\???

int main() {
	double a, b, p, c, d, q;
	double x, y;

	while (cin >> a >> b >> p >> c >> d >> q)
	{
		x = (p*d - b*q) / (a*d - b*c);
		y = (a*q - p*c) / (a*d - b*c);
		if (-0.0005 < x && x < 0.0005) x = 0.0;
		if (-0.0005 < y && y < 0.0005) y = 0.0;
		cout << fixed << setprecision(3) << x << " " << y << endl;
	}
	return 0;
}

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

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

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

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

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

	while(cin >> a >> b >> c >> d >> e >> f)
		houteisiki(a, b, c, d, e, f);

	return 0;
}

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

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

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

using namespace std;

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

int main(){
	while(cin >> a >> b >> c >> d >> e >> f){
		printf("%8.3lf ",(c/a)-((b*c*d-a*b*f)/(a*b*d-a*a*e)));

		printf("%8.3lf\n",(c*d-a*f)/(b*d-a*e));
	}
    return 0;
}

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

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

C++: #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cctype>
#include<algorithm>
#define pf printf
#define sf scanf
#define wh while
#define db double
#define LL long long
#define _USE_MATH_DEFINES
#define re(i,a,b) for(int i=a;i<b;i++)
#define rev(i,a,b) for(int i=a;i>=b;i--)

using namespace std;

int main()
{
    db a,b,c,d,e,f,x;
    wh(cin>>a>>b>>c>>d>>e>>f){
        db q=(b/a)*d*(-1);
        db r=(c/a)*d*(-1);
        db y=((r+f)/(q+e));
        db p=e*y;
        if(p==f)x=0;
        else x=(f-p)/d;
        pf("%.3lf %.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)
	{
		x= (c*e-b*f)/(a*e-b*d);
		y= (c*d-a*f)/(b*d-a*e);
		if(x == -0.00){x=0.00;}
		if(y == -0.00){y=0.00;}
		cout<<setprecision(3)<<fixed;
		cout<<x<<" "<<y<<endl;
	}
	return 0;
}