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>
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);
                cout<<fixed;
		cout<<x<<" "<<y<<endl;
	}
	return 0;
}

C++: 5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 
#include <iostream>
 
using namespace std;
 
int main(int argc, char **argv)
{
    double a, b, c, d, e, f, tmp, s, t;
     
    while((cin >> a >> b >> c >> d >> e >> f)){
        tmp = (a*e-b*d);
        s = ((e*c-b*f)/tmp);
        t = ((a*f-d*c)/tmp);
         
        if(s == -0.0){
            s = 0.0;
        }
        if(t == -0.0){
            t = 0.0;
        }
        printf("%.3f %.3f\n", s, t);
    }
     
    return 0;
}

C++: using namespace std;
int main(){
    int a,b,c,d,e,f;
    double x,y;
    while(cin>>a>>b>>c>>d>>e>>f){
        if(x != 0) x=(b*f-c*e)/(b*d-a*e);
        else x=0;
        
        if(y != 0)y = (a*f-c*d)/(a*e-b*d);
        else y = 0;
        
        cout<<fixed<<setprecision(3)<<x<<' '<<y<<endl;
    }
    return 0;
}

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

int main() {
	int cnt = 0;
	long long 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;
}

C++: #include<stdio.h>
int main() {
    double a, b, c, d, e, f;
    double x, y, z;
    int i;
    for (i = 0; i < 2; i++) {
        scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f);
        z = d / a;
        b *= z;
        c *= z;
        y = (c - f) / (b - e);
        x = (f - e*y) / d;
        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;
 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;
 	
 printf("%0.3f %0.3lf",x,y);
 	
	}
 
}

C++: #define _CRT_SECURE_NO_WARNINGS
#include<cstdio>

int main(){
	double a, b, c, d, e, f;
	scanf("%lf%lf%lf%lf%lf%lf", &a, &b, &c, &d, &e, &f);
	double y = (c * d - a * f) / (b * d - a * e);
	printf("%.4f %.4f", ((c - b * y) / a, y));
	return 0;
}

C++: const int tt = 10000;

#include<iostream>
#include<string>
#include<sstream>
using namespace std;

string toStr(int n);
string intToString(int n);

int main() {
  int a, b, c, d, e, f;
  
  while(cin >> a >> b >> c >> d >> e >> f) {
    c = c * tt;
    f = f * tt;

    int det = a * e - b * d;

    int x = ( e * c - b * f) / det;
    int y = (-d * c + a * f) / det;
//    cout << x << y << endl;

    cout << toStr(x) << " " << toStr(y) << endl;
  }
}

string toStr(int n) {
  string pm, val;
  
  if (n < 0) {
    pm = "-";
    n = -n;
  } else {
    pm = "";
  }

  int ipart = n / tt;
  int fpart = (n - ipart * tt) + tt + 5;

  val = pm + intToString(ipart) + "." + intToString(fpart).substr(1, 3);
  return val;
}

string intToString(int n) {
  stringstream ss;
  ss << n;
  return ss.str();
}

C++: /* All men have limits. They learn what they are and learn
   not to exceed them, I ignore mine. -Batman           */
#include <bits/stdc++.h>
//#include <iostream>
//#include <vector>
//#include <Windows.h>
using namespace std;

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

C++: #include <cstdio>
int main() {
	double a,b,c,d,e,f;
	double x,y;
	while(scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f)!=EOF) {
		y=(a*f-c*d)/(a*e-b*d);
		x=(-b*y+c)/a;
		printf("%.3lf %.3lf\n",x,y);
	}
}

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

int main(){
	double a,b,c,d,e,f,x,y;
	while(true){
		cin>>a>>b>>c>>d>>e>>f;
		if(cin.eof()) break;
		x=(b*f-c*e)/(b*d-a*e);
		y=(c-a*x)/b;
		printf("%.3f %.3f\n",x,y);
	}
	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 + 0;
        double i = (-d * c + a * f) / g + 0;
        cout << fixed << setprecision(3) << h << " " << i << endl;
    }
    return 0;
}

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

int main()
{
  double a[10],b[10];
  for(int i=0;i<6;i++)
  {

	  cin>>a[i];
	  if((a[i]>1000)||(a[i]<-1000)){
	    cout << "nomber error" <<endl;
	    return 0;
     }
  }
  for(int i=0;i<6;i++)
  {

	  cin>>b[i];
	  if((b[i]>1000)||(b[i]<-1000)){
	    cout << "nomber error" <<endl;
	    return 0;
     }
  }
  cout<<fixed<<setprecision(3)<<(a[2]*a[4]-a[1]*a[5])/(a[0]*a[4]-a[1]*a[3])<<" ";
  cout<<fixed<<setprecision(3)<<(a[2]*a[3]-a[0]*a[5])/(a[1]*a[3]-a[0]*a[4])<<" ";
  cout<<endl;
  cout<<fixed<<setprecision(3)<<(b[2]*b[4]-b[1]*b[5])/(b[0]*b[4]-b[1]*b[3])<<" ";
  cout<<fixed<<setprecision(3)<<(b[2]*b[3]-b[0]*b[5])/(b[1]*b[3]-b[0]*b[4])<<" ";
  return 0;
}

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

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