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<iostream>
#include<cmath>
#include<string>

int main(int, char**)
{
	double a, b, c, d, e, f = 0;
	while (std::cin >> a >> b >> c >> d >> e >> f)
	{
		double y = (c * (a - d) - a * (c - f)) / (b * (a - d) - a * (b - e));
		printf_s("%.3f %.3f\n", ((c - f) - (b - e) * y) / (a - d), y);
	}
}

C++: #include <bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <math.h>
#include<algorithm>
#include <utility>
using namespace std;
int main() {
	double a, b, c, d, e, f, x, y;
	while (cin >> a >> b >> c >> d >> e >> f) {
		x = (e*c - b*f) / (a*e - b*d);
		y = (c*d - a*f) / (-a*e + b*d);
		if (x == -0.000) {
			x = abs(x);
		}
		if (y == -0.000) {
			y = abs(y);
		}
		printf("%.3f %.3f\n", x, y);
	}
	return 0;
}

C++: #include<iostream>
#include<stdio.h>
using namespace std;
int main() {
	double a, b, c, d, e, f, x, y;
	while (!cin.eof()) {
		cin >> a >> b >> c >> d >> e >> f;
		double bd = b*d;
		double ea = e*a;
		double cd = c*d;
		double fa = f*a;
		y = (cd - fa) / (bd - ea);
		x = (c - b*y) / a;
		printf("%.3f %.3f\n", x, y);
	}
}

C++: #include <stdio.h>
#include <stdlib.h>
#include <string.h>


void main(void) {
	char string[99];
	printf("a,b,c,d,e,f??????????????????????????§??\?????????????????????\n");
	double a=0, b=0, c=0, d=0, e=0, f=0;
	scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f);
	double x = (f*b - e*c) / (d*b - e*a);
	double y = (f*a - d*c) / (e*a - d*b);
	printf("%f %f\n", x, y);
	return;
}

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

// ax + by = c  ->  adx = cd - dby
// dx + ey = f  ->  adx = fa - aey

// (db - ae)y = cd - fa
// y = (cd - fa) / (db - ae)
// x = (c - by) / a

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

C++: #include <conio.h>
#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)
	{
		-1000 <= a, b, c, d, e, f <= 1000;
		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;
	}
        cin.get();
        getch();
	return 0;
}

C++: #include <stdio.h>

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){

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

		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,x,y;
	while(cin >> a >> b >> c >> d >> e >> f){
		x=(f-c*e/b)/(d-a*e/b);
		y=(f-c*d/a)/(e-b*d/a);

		cout << setprecision(4) << x << " " << y << endl;
	}

	return 0;
}

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

using namespace std;

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

	while(cin >> a, cin >> b, cin >> c, cin >> d, cin >> e, cin >> 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 <stdio.h>
using namespace std;

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

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

	return 0;

}

C++: #include <iostream>

using namespace std;

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

C++: #include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
int main(){
 double a,b,c,d,e,f;
 while(cin>>a>>b>>c>>d>>e>>f){
  double x = (c*e-f*b)/(a*e-b*d);
  double y = (a*f-d*c)/(a*e-d*b);
  if(x == 0) x = 0.0;
  if(y == 0) y = 0.0;
  printf("%.3lf %.3lf\n",x,y);
 }
 return 0;
}

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

using namespace std;

int main()
{
 double a,b,c,d,e,f;
 double n;
 double x,y,ty,tc;
	while( cin>>a>>b>>c>>d>>e>>f )
	{
 	n=(a/d);
 	d = d * n;
 	e = e * n;
 	f = f * n;

	ty = b-e; 	
 	tc = c-f;
 	y = tc/ty;

 	tc = c - (b*y);
 	x = tc/a;
 	
 	cout << setiosflags(ios::fixed);
	cout << setprecision(3);
 	cout << x <<" "<< y <<endl;
 	
	}
 
}

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

using namespace std;

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

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

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

C++: #include<iostream>
int gcd(int x,int y){
	if(y==0)return x;
	else return gcd(y,x%y);
}
int main(){
	while(1){
		int a,b,c,d,e,f;
		std::cin>>a>>b>>c>>d>>e>>f;
		int b2=b*gcd(a,d)/a;
		int e2=e*gcd(a,d)/d;
		int c2=c*gcd(a,d)/a;
		int f2=f*gcd(a,d)/d;
		int y=(f2-c2)/(e2-b2);
		int x=(e-b*y)/a;
		std::cout<<x<<" "<<y<<std::endl;

		break;
	}
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <map>

typedef pair<int,int> mat;
using namespace std;
int main()
{
int a,b,c,d,e,f;
double A[2][2];
double B[2];
double inv_A[2][2];
scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f);
int det = a*e-b*d;
A[0][0]=a; A[0][1] = b;
A[1][0]=d; A[1][1] = e;
B[0] = c;
B[1] = f; 

inv_A[0][0]=1.0/(double)det *A[1][1]; inv_A[0][1]=1.0/(double)det *-A[1][1];
inv_A[1][0]=1.0/(double)det *-A[1][0]; inv_A[1][1]=1.0/(double)det *A[0][0];

double res[2];
res[0]=0;
res[1]=0;

for(int i=0;i<2;i++){
for(int j=0;j<2;j++){
for(int k=0;k<2;k++){
res[i]+=inv_A[j][k]*B[k];
}
}
}

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