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<queue>
#include<stack>
#include<cstdio>
using namespace std;
double a,b,c,d,e,f,x,y;
int main(){
	while(cin>>a>>b>>c>>d>>e>>f){
		x=(c*e-f*b)/(a*e-d*b);
		y=(c-a*x)/b;
		printf("%.3f %.3f\n",x+(1e-10),y+(1e-10));
	}
	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 <stdio.h>

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

  while(scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f)!=EOF) {
    x=(double)(c*e-b*f)/(double)(a*e-b*d);
    y=(double)(a*f-c*d)/(double)(a*e-b*d);
    printf("%.3f %.3f\n",x,y);
  }
  
  return 0;
}

C++: #include <cmath>
#include <cstdio>
#include <cfloat>

namespace
{
	struct equation
	{
		double a, b, c;
	};
	auto calculate_x = [](equation e1, equation e2)
	{
		return (e1.c * e2.b - e1.b * e2.c) / (e1.a * e2.b - e1.b * e2.a);
	};
	auto calculate_y = [](equation e1, equation e2)
	{
		return (e1.c * e2.a - e1.a * e2.c) / (e1.b * e2.a - e1.a * e2.b);
	};
	auto round_off = [](double d, unsigned int digit)
	{
		d *= std::pow(10, digit - 1);
		d = std::round(d);
		d /= std::pow(10, digit - 1);
		return d;
	};
}

namespace
{
	equation e1, e2;
}

int main()
{
	while (std::scanf("%lf", &e1.a) != EOF)
	{
		std::scanf("%lf%lf%lf%lf%lf", &e1.b, &e1.c, &e2.a, &e2.b, &e2.c);
		double x = round_off(calculate_x(e1, e2), 4);
		double y = round_off(calculate_y(e1, e2), 4);
		std::printf("%.3f %.3f\n", x + DBL_EPSILON, y + DBL_EPSILON);
	}
	return 0;
}

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

int main() {
	float a[6];
	float x,y;
	while(true)
		cin >> a[0];
		cin >> a[1];
		cin >> a[2];
		cin >> a[3];
		cin >> a[4];
		cin >> a[5];
		if(cin.eof())
			break;
			
		x = (a[4]*a[2]-a[1]*a[5])/(a[0]*a[4]-a[1]*a[3]);
		y = (-a[3]*a[2]+a[0]*a[5])/(a[0]*a[4]-a[1]*a[3]);
		
		cout.precision(3);
		cout << x << " " << y << endl;
	}
	return 0;
}

C++: import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        while (scanner.hasNextInt()) {
            int a = scanner.nextInt();
            int b = scanner.nextInt();
            int c = scanner.nextInt();
            int d = scanner.nextInt();
            int e = scanner.nextInt();
            int f = scanner.nextInt();

            Equation equation_1 = new Equation(a, b, c);
            Equation equation_2 = new Equation(d, e, f);

            double[] solution = solve(equation_1, equation_2);

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

    static double[] solve(Equation left, Equation right) {
        double determinant = left.a * right.b - right.a * left.b;
        double x = (right.b * left.c - left.b * right.c) / determinant;
        double y = (-right.a * left.c + left.a * right.c) / determinant;

        double[] result = { x, y };
        return result;
    }

}

// ax + by = c
class Equation {

    Equation(int a, int b, int c) {
        this.a = a;
        this.b = b;
        this.c = c;
    }

    public int a;
    public int b;
    public int c;

}

C++: #include <bits/stdc++.h>
using namespace std;
#define FOR(i, n) for(int i = 0; i < (n); i++)
#define MEM(a, x) memset(a, x, sizeof(a))
#define ALL(a) a.begin(), a.end()
#define UNIQUE(a) a.erase(unique(ALL(a)), a.end())
typedef long long ll;

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

int main(int argc, char const *argv[]) {
	ios_base::sync_with_stdio(false);
	while (cin >> a >> b >> c >> d >> e >> f) {
		printf("%.3lf %.3lf\n", (e*c-f*b)/(e*a-b*d), (d*c-a*f)/(d*b-a*e));
	}
	
	return 0;
}

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

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

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

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

	while( cin >> a >> b >> c >> d >> e >> f ) {
		double x, y;

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

		cout << (x == 0 ? setprecision(3) : setprecision(4)) << showpoint << x;
		cout << " " << (y == 0 ? setprecision(3) : setprecision(4)) << y << endl;
	}
}

C++: #include <iostream>
 
using namespace std;
 
#define EPS 1e-9
 
int main()
{
    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*x)/(float)b;
         
 
        printf("%.3f %.3f\n",x+EPS,y+EPS);
    }
 
 
 
    return 0;
}

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

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

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

using namespace std;

int main() {

	int i;
	double no[6] = { 0 }, a, b;

	while (cin >> no[0]) {
	
	for (i = 1; i < 6; i++) {
			cin >> no[i];
		}
		
		a = ((no[2] * no[4]) - (no[1] * no[5])) / ((no[0] * no[4]) - (no[1] * no[3]));
		b = ((no[3] * no[2]) - (no[0] * no[5])) / ((no[1] * no[3]) - (no[0] * no[4]));
		if (a == 0)
			a = 0;
		if (b == 0)
			b = 0;
		
		printf("%.3f %.3f", a, b);
	} 

	return 0;
}

C++: while(True):
	try:
		a,b,c,d,e,f = map(float,input().split(" "))
		z = a*e - b*d
		if(z!=0):
			x = (c*e-b*f)/z
			y = (a*f-c*d)/z
		print("{:.3f} {:.3f}".format(x+0,y+0))
	except:
		break

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