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++: // http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0004
#include <bits/stdc++.h>
using namespace std;

int main(){
  for(double a,b,c,d,e,f,x,y; 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);

    char buff[100];
    sprintf(buff, "%.3f", x);
    if(!strcmp(buff, "-0.000")) x = 0;
    sprintf(buff, "%.3f", y);
    if(!strcmp(buff, "-0.000")) y = 0;
    cout<<fixed; // ?°???°?????\??????????????????????????????????????????????????°???????????°??????????????????
    cout<<setprecision(3)<<x<<" "<<y<<endl;
  }
  return EXIT_SUCCESS;
}

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

#define REP(i, a) for(int i=0;i<(int)a;++i)
using namespace std;

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

int main() {
    solver();
    return 0;
}

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

using namespace std;

int main(){

  int i=0;
  float a, b, c, d, e, f;
  float temp;
  float x, y;

  while( cin >> a >> b >> c >> d >> e >> f ) {

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

    cout << fixed << setprecision(3) << x << " " << y << "\n";
  }

  return 0;
}

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

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

	cin >> a >> b >> c >> d >> e >> f;

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

	cout << showpoint << setprecision(3);
	cout << setiosflags( ios::fixed );
	cout << x << " " << y << endl;
}

C++: #include <iostream>
using namespace std;
int main(){
    int a,b,c,d,e,f;
    double x,y;
    while(cin>>a>>b>>c>>d>>e>>f){
        x=(b*f-c*e)/(b*d-a*e);
        y = (a*f-c*d)/(a*e-b*d);
        printf("%.3f %.3f\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;
	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;
	
	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 x = (b*f - c*e)/(b*d - a*e);
        double y = (a*f - c*d)/(a*e - b*d);
  if(x == 0){x = 0;}
  if(y == 0){y = 0;}
        printf("%.3f %.3f\n", x, y);
    }
    return 0;
}

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

C++: #include <iostream>
#include <iomanip>
using namespace std;
int main(void){
    // Here your code !
    double a, b, c, d, e, f;
    while (cin >> a >> b >> c >> d >> e >> f) {
        double x = (c * e - b * f) / (a * e - b * d);
        double y = (a * f - c * d) / (a * e - b * d);
        x *= 1000; x = x + (x > 0 ? 0.5 : -0.5); x = (int)x;
        y *= 1000; y = y + (y > 0 ? 0.5 : -0.5); y = (int)y;
        //cout << %.3f %.3f\n << x / 1000 << y / 1000 << endl;
        cout << fixed << setprecision(4) << x /1000 << " " << y / 1000 <<endl;
    }
    return 0;
}

C++: #define _USE_MATH_DEFINES

#include <iostream>
#include <string>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <utility>
#include <vector>
#include <numeric>

using namespace std;

int main()
{
	double a, b, c, d, e, f;
	for (; cin >> a >> b >> c >> d >> e >> f;)
	{
		double x, y;
		if (a == 0 || b == 0 || d == 0 || e == 0)
		{
			if (a == 0)
			{
				y = c / b;
				x = (f - e * y) / d;
			}
			else if (b == 0)
			{
				x = c / a;
				y = (f - d * x) / e;
			}

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

			double d0 = d * b;
			double f0 = f * b;

			x = (f0 - c0) / (d0 - a0);

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

		cout << fixed << setprecision(3) << x << " " << y << endl;

	}
}

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

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

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

using namespace std;

double solutionY();
double solutionX(double);
double a1,b1,c1,d1,e1,f1;

int main(){
  while(cin >> a1 >> b1 >> c1 >> d1 >> e1 >> f1){
    double x,y;
    
    y = solutionY();
    x = solutionX(y);
    
    cout << fixed << setprecision(3) << x << " " << y << endl ;
  }
  return 0;
}

double solutionY(){
  double b,c,e,f;
  b = b1/a1;
  c = c1/a1;

  e = e1/d1;
  f = f1/d1;
  
  return (c - f)/(b - e);
}

double solutionX(double y){
  double b,c;
  b = b1/a1;
  c = c1/a1;
  
  return (c - b*y);
}

C++: #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
double gcd( double m, double n );
double lcm( double m, double n );
int main(int argc, const char * argv[])
{
    double a=0.0;
    double b=0.0;
    double c=0.0;
    double d=0.0;
    double e=0.0;
    double f=0.0;
    double x=0.0;
    double y=0.0;
    int end=0;
    
    while(scanf("%d",&end)!=EOF){
        a=end;
        scanf("%lf",&b);
        scanf("%lf",&c);
        scanf("%lf",&d);
        scanf("%lf",&e);
        scanf("%lf",&f);
        double ad = lcm( a,d );
        printf("%lf\n",ad);
        
        double a2 = ad/a;
        double b2 = b*a2;
        double c2 = c*a2;
        
        double d2 = ad/d;
        double e2 = e*d2;
        double f2 = f*d2;
        
        y = (c2-f2)/(b2-e2);
        x = (c-b*y)/a;
        
        printf("%.3lf",x);
        printf(" ");
        printf("%.3lf\n",y);
        
    }
    
}
double gcd( double m, double n )
{
	if ( ( 0.0 == m ) || ( 0.0 == n ) )
		return 0;
	while( m != n )
	{
		if ( m > n ) m = m - n;
		else         n = n - m;
	}
	return m;
}

double lcm( double m, double n )
{
	if ( ( 0.0 == m ) || ( 0.0 == n ) )
		return 0;
	
	return ((m / gcd(m, n)) * n);
}