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>
#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;
}

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

C++: #include <iostream>
#include <cstdio>
using namespace std;
int main(){
	float a,b,c,d,e,f,x,y;
	while(cin>>a>>b>>c>>d>>e>>f){
		y = (d*c - a*f)/(d*b - a*e);
		x = (f - e*y)/d;
	printf("%0.3f %0.3f \n",x,y);
	}
}

C++: #include <stdio.h>

#define X 0
#define Y 1
#define C 2
#define SIKI1 0
#define SIKI2 1
#define LEFT  0
#define RIGHT 1

int main(){
	double A[3][3][3];
	int n[6];

	while( scanf("%d %d %d %d %d %d",&n[0],&n[1],&n[2],&n[3],&n[4],&n[5]) != EOF){
		//ÏÌú»
		for(int i=0 ; i<=RIGHT ; i++){
			for(int j=0 ; j<=SIKI2 ; j++){
				for(int k=0 ; k<=C ; k++){
					A[i][j][k] = 0;
				}
			}
		}

		//lÌãü
		A[LEFT][SIKI1][X]  = n[0];
		A[LEFT][SIKI1][Y]  = n[1];
		A[RIGHT][SIKI1][C] = n[2];
		A[LEFT][SIKI2][X]  = n[3];
		A[LEFT][SIKI2][Y]  = n[4];
		A[RIGHT][SIKI2][C] = n[5];

		//®PÌXð¶Ó©çEÓÖÚ·é
		A[ RIGHT ][ SIKI1 ][ X ]  += (-1.0)*(A[ LEFT ][ SIKI1 ][ X ]);
		A[ LEFT  ][ SIKI1 ][ X ]  = 0;

		//®PÌ¼ÓðYÌWÅé		
		A[ RIGHT ][ SIKI1 ][ X ]  /= A[ LEFT ][ SIKI1 ][ Y ];
		A[ RIGHT ][ SIKI1 ][ C ]  /= A[ LEFT ][ SIKI1 ][ Y ];
		A[ LEFT  ][ SIKI1 ][ Y ]  = 1;

		//®QÌYÉãüµÄ®Qð(ax = b)Ì`É·é
		int a = A[ LEFT ][ SIKI2 ][ Y ];
		A[ LEFT  ][ SIKI2 ][ X ]  += a * A[ RIGHT ][ SIKI1 ][ X ];
		A[ LEFT  ][ SIKI2 ][ Y ]   = 0;
		A[ RIGHT ][ SIKI2 ][ C ]  += a * A[ RIGHT ][ SIKI1 ][ C ] * (-1.0);
		//XYÌðªÜé
		double answerX = A[ RIGHT ][ SIKI2 ][ C ] / A[ LEFT ][ SIKI2 ][ X ];
		double answerY = (n[2] + n[0]*answerX*(-1.0))/n[1];
		
		//¬æSÊðlÌÜü·é
		if( (((int)(answerX*10000))%10) >= 5){
			answerX += 0.001;
		}
		if( (((int)(answerY*10000))%10) >= 5){
			answerY += 0.001;
		}
		if(answerX==-0.0){
			answerX = 0;
		}
		if(answerY==-0.0){
			answerY = 0;
		}
		//ðÌoÍ
		printf("%.6f %.6f\n", answerX , answerY);
	}

	return 0;
}

C++: #include <cstdio>

int main()
{
        float A[2][2], B[2];

        while (scanf("%f %f %f %f %f %f",
                                 &A[0][0], &A[0][1], &B[0],
                                 &A[1][0], &A[1][1], &B[1]) != EOF) {
                float det = A[0][0] * A[1][1] - A[0][1] * A[1][0];
                float invA[2][2];
                invA[0][0] = A[1][1] / det;
                invA[0][1] = -A[0][1] / det;
                invA[1][0] = -A[1][0] / det;
                invA[1][1] = A[0][0] / det;
                float ans[2] = {0, 0};
                for (int i = 0; i < 2; i++) {
                        for (int j = 0; j < 2; j++) {
                                ans[i] += B[j] * invA[i][j];
                        }
                }

                printf("%.3f %.3f\n", ans[0], ans[1]);
        }
        return 0;
}

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

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

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

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

int main() {
    string line;
    while (getline(cin, line)) {
        int a, b, c, d, e, f;
        stringstream ss(line);
        ss >> a >> b >> c >> d >> e >> f;


        double x = 0.0;
        if (c*e - b*f != 0)
            x = static_cast<double>(c*e - b*f) / (a*e - b*d);
        double y = 0.0;
        if (a*f - c*d != 0)
            y = static_cast<double>(a*f - c*d) / (a*e - b*d);
        cout.setf(ios_base::fixed, ios_base::floatfield);
        cout << std::setprecision(3) << x << " " << y << endl;
    }
}