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 <cstdio>
#include <queue>
#include <vector>

using namespace std;


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 = (double)(c*e - b*f) / (double)(a*e - d*b);
		y = (c - a*x)/b;
		if(x == -0.0){ x = 0; }
		if(y == -0.0){ y = 0; }
		printf("%.3f %.3f\n",x,y);
	}
	return 0;
}

C++: #include <stdio.h>

int main(void)
{
	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){
		
		x = (e * c + (-b) * f) / (a * e - d * b);
		y = ((-d) * c + a * f) / (a * e - d * b);
		if (x == 0) x = 0.000;
		else if (y == 0) y = 0.000;
		
		printf("%.3f %.3f\n", x , y);
	}
	
	return (0);
}

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

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

C++: #include<stdio.h>
int main(){
	double a,b,c,d,e,f;
	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){
		A=a*d;
		B=b*d;
		C=c*d;
		D=a*d;
		E=a*e;
		F=a*f;
//		printf(" %lfx + %lfy = %lf\n",A,B,C);
//		printf(" %lfx + %lfy = %lf\n",D,E,F);
		if(B==E){y=0;}
		else{y=(C-F)/(B-E);}
		x=(c-b*y)/a;
		printf("%1.3lf %1.3lf",x,y);
	}
	return 0;
}

C++: #include<cstdio>

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)!=EOF){
    x=(c*e-b*f)/(a*e-b*d);
    y=(a*f-d*c)/(a*e-b*d);
    if(x==0)x=0;
    if(y==0)y=0;
    printf("%.3f %.3f\n",x,y);
  }
  return 0;
}

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

int main() {
	std::cout << std::setprecision(3);
	std::cout.setf(std::ios::fixed, std::ios::floatfield);
	double a, b, c, d, e, f;
	while( std::cin >> a >> b >> c >> d >> e >> f ) {
		const double x = (b*f-c*e) / (b*d-a*e);
		const double y = (c-a*x) / b;
		std::cout << ((-0.0005<=x && x<0.0005)?0.0:x) << " " << ((-0.0005<=y && y<0.0005)?0.0:y) << std::endl; 
	}
}

C++: #include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <iomanip>
#include <cassert>
using namespace std;

#define GET_ARG(a,b,c,F,...) F
#define REP3(i,s,e) for (i = s; i <= e; i++)
#define REP2(i,n) REP3 (i,0,(int)(n)-1)
#define REP(...) GET_ARG (__VA_ARGS__,REP3,REP2) (__VA_ARGS__)
#define RREP3(i,s,e) for (i = s; i >= e; i--)
#define RREP2(i,n) RREP3 (i,(int)(n)-1,0)
#define RREP(...) GET_ARG (__VA_ARGS__,RREP3,RREP2) (__VA_ARGS__)
#define DEBUG(x) cerr << #x ": " << x << endl

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

C++: #include<bits/stdc++.h>
using namespace std;

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

C++: #include<iostream>
#include<string>
#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=(c-b*f/e)/(a-b*d/e);
		y=(c-a*f/d)/(b-a*e/d);
		cout<<fixed<<setprecision(3)<<x<<" ";
		cout<<fixed<<setprecision(3)<<y<<endl;
	}
	return 0;
}

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

double abs2(const double n){
	if (n < 0) return -(n);
	return n;
}

int main(){
	double a, b, c, d, e, f;
	double x, y;
	double A, B, C;
	const double p = 0.00000001;

	while (cin >> a >> b >> c >> d >> e >> f){
		A = (a*e) - (b*d);
		B = (c*e) - (b*f);
		C = (a*f) - (c*d);

		x = B / A;
		y = C / A;
		
		if (abs2(x) < p) x = 0;
		if (abs2(y) < p) y = 0;

		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;
        double det;
        
        while( scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF ){
                det = a*e - b*d;
                printf("%.3lf %.3lf\n", (e*c-b*f)/det, (a*f-c*d)/det);
        }
        return 0;
}

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

using namespace std;
double sg(double n); 
int main()
{
	int a[1000],b[1000],c[1000],d[1000],e[1000],f[1000];
	float x[1000],y[1000];
	int w_x,w_y;
	int len=0;
	while (cin >> a[len] >> b[len] >> c[len] >> d[len] >> e[len] >> f[len])
		len++;

	for (int i=0; i < len; i++) {
		x[i] =  ((e[i] * c[i] - b[i] * f[i]) / (e[i] * a[i] - b[i] * d[i]));
		y[i] =  ((c[i] * d[i] - f[i] * a[i]) / (b[i] * d[i] - a[i] * e[i]));
	}
	for (int i=0; i < len; i++) {
		printf("%.3lf %.3lf\n",sg(x[i]),sg(y[i]));
	}
	return 0;
}
double sg(double n)
{
	int w;
	n = n * 10000;
	w = (int)n % 10;
	if (w > 4) 
		n += 1.0;
	return n /= 10000;
}

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

using namespace std;

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


double x(double, double, double, double, double, double) {

	return (c*e - b*f) / (a*e - b*d);
}

double y(double, double, double, double, double, double) {

	return (a*f - c*d) / (a*e - b*d);
}

double round(double dat, int keta ){

	int fct;
	fct = (int)pow(10, keta - 1);
	dat *= fct;
	dat += (dat < 0) ? -0.5 : 0.5;
	dat = (int)(dat);
	dat /= fct;
	return dat;
}

int main()
{
	double x1, x2, y1, y2;
	cin >> a >> b >> c >> d >> e >> f;

	x1 = x(a, b, c, d, e, f);
	y1 = y(a, b, c, d, e, f);

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

	x2 = x(a, b, c, d, e, f);
	y2 = y(a, b, c, d, e, f);

	cout << fixed << setprecision(3) << round(x1,3) << " " << round(y1,3) << endl;
	cout << fixed << setprecision(3) << round(x2,3) << " " << round(y2,3) << endl;

	return 0;
}