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 <stdio.h>


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

    while (scanf("%d %d %d %d %d %d", 
    &a, &b, &c, &d, &e, &f)==6){
        x = (e*c-b*f)/(a*e-b*d);
        y = (-d*c+a*f)/(a*e-b*d);
        // round
        tmp = ((int)(x*1000)) % 10;
        if (x<5) x -= tmp/1000;
        if (x>=5) x += (10-tmp)/1000;
        tmp = ((int)(y*1000)) % 10;
        if (y<5) y -= tmp/1000;
        if (y>=5) y += (10-tmp)/1000;
        // output
        printf("%.3f %.3f\n", x, y);
    }
    return 0;
}

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

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

C++: #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <list>
#include <vector>
using namespace std;

int main(int argc, char const *argv[]) {
  double x, y;
  double a, b, c, d, e, f;
  while (!(cin >> a >> b >> c >> d >> e >> f).eof()) {
    x = (e * c - b * f) / (a * e - b * d);
    y = (a * f - c * d) / (a * e - b * d);
    if (x == 0) {
      x = 0;
    }
    if (y == 0) {
      y = 0;
    }
    std::cout << fixed << setprecision(3) << x << " " << y << '\n';
  }
  return 0;
}

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

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

    }
    return 0;
}

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

C++: #include<stdio.h>
int main(void) {
	double a, b, c, d, e, f, xans, yans;
	while (scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF)
	{
		xans = ((e*c - f*b) / (a*e - d*b)) + 0.0005;
		yans = ((c*d - f*a) / (d*b - a*e)) + 0.0005;
		printf("%.3f %.3f\n", xans, yans);
	}
	return 0;
}

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

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

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


int main() {
	ios::sync_with_stdio(false);
	int a, b, c, d, e, f;
	
	cin >> a >> b >> c >> d >> e >> f;
	double x = (e*c-b*f)/(a*e-b*d);
	double y = (-c*d+a*f)/(a*e-b*d);
	cout << fixed << setprecision(3) << x << " " << y;
	
	while(cin >> a >> b >> c >> d >> e >> f){
		cout << "\n";
		double x = (e*c-b*f)/(a*e-b*d);
		double y = (-c*d+a*f)/(a*e-b*d);
		cout << fixed << setprecision(3) << x << " " << y;
	}

}

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

int main()
{
	double A, B, C, D, E, F, X, Y, G , H;

	while(cin >> A >> B >> C >> D >> E >> F)
	{
		G = A / D;
		D *= G;
		E *= G;
		F *= G;
		Y = (F-C) / (E-B);
		
		D /= G;
		E /= G;
		F /= G;
		H = B / E;
		D *= H;
		E *= H;
		F *= H;
		X = (F-C) / (D-A);

		X= floor(X*1000+0.5)/1000;
		Y= floor(Y*1000+0.5)/1000;

		if(Y==0){
			Y=0;
		}

		if(X==0){
			X=0;
		}

		cout<<fixed<<setprecision(3)<<X<<" "<<fixed<<setprecision(3)<<Y<<endl;
	}

	return 0;
}

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

int main(){
	char buf[18];
	double a,b,c,d,e,f,x,y;
	while(fgets(buf,sizeof(buf),stdin)!=NULL){
		sscanf_s(buf,"%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f);
		x=(b*f-c*e)/(b*d-a*e);
		y=-1.0*(x*a-c)/b;
		printf("%.3lf %.3lf\n",x==0.0 ? fabs(x) : x, y==0.0 ? fabs(y) : y);
	}

    return 0;
}

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

int main(void)
{
	// ax+by=c,dx+ey=f => ax+by=c,-(a/d)*dx+-(a/d)*ey=-(a/d)*f => ax+by=c,-ax-aey/d=-af/d => by-aey/d=c-af/d => (b-ae/d)y = c-af/d => y=(c-af/d)/(b-ae/d)
	// ax+by=c, ax=c-by, x=(c-by)/a
	
	signed int a, b, c, d, e, f;
	double x, y;
	
	do
	{
		if(std::cin >> a, !std::cin) break;
		std::cin >> b >> c >> d >> e >> f;
		if(!std::cin) break;
		y = (c-a*f/(double)d)/(b-a*e/(double)d);
		x = (c-b*y)/(double)a;
		printf("%.3lf %.3lf\n", x, y);
	} while(true);

	return 0;
}

C++: /*************************************************************************
	> File Name: 23.cpp
	> Author: ralph
	> Mail: 1694487365@qq.com
	> Created Time: 2018年12月21日 星期五 21时32分48秒
 ************************************************************************/

#include<bits/stdc++.h>
using namespace std;
int main()
{
    float a,b,c,d,e,f;
    while(cin>>a>>b>>c>>d>>e>>f) printf("%.3f %.3f\n",(c*e-b*f)/(a*e-b*d),(a*f-c*d)/(a*e-b*d));
}

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

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

C++: #include<iostream>
#include<iomanip>
using namespace std;
int main()
{
	int man(int x, int y);
	double b=0, c=0, e, f, y, z, k, l;
	int x;
	double a, d;
	while (cin >> a >> b >> c >> d >> e >> f&&a != 0 && b != 0 && c != 0 && d != 0 && e != 0 && f != 0)
	{
		a = int(a);
		d = int(d);
		double s = b, v = c;
		x = man(a, d);
		a = double(a);
		d = double(d);
		x = double(x);
		y = x / a;
		z = x / d;
		b = b*y;
		c = c*y;
		e = e*z;
		f *= z;
		k = (c - f) / (b - e);
		l = (v - s*k) / a;
		cout << setiosflags(ios::fixed) << setprecision(4);
		cout << l << ' ' << k << endl;
	}
	return 0;
	
}
int man(int x, int y)
{
	int a, b, c;
	a = x*y;
	while (y != 0)
	{
		b = x%y;
		x = y;
		y = b;

	}
	b = a / x;
	return b;
}

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

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

int main() {
  while (1) {
    if (scanf("%d%d%d%d%d%d", &a, &b, &c, &d, &e, &f) != 6) break;

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

    x = int(x*1000)/1000.0;
    y = int(y*1000)/1000.0;

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