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++: /*************************************************************************
	> 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);
  }
}

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

int main(void){
	double x1[1000],y1[1000];
	int a=0,b=0,c=0,d=0,e=0,f=0,x2,y2,i=0,j;
    
    while(scanf("%d %d %d %d %d %d\n",&a,&b,&c,&d,&e,&f) != EOF)
	{
		x2 = ((c * e -b * f) / (a * e - b * d))*1000+0.5;
	    y2 = ((c - a * x2) / b)*1000+0.5;

		x1[i] = x2/1000;
		y1[i] = y2/1000;

		i+=1;
	}
	for(j=0;j<i;j++)
	{
		printf("%f %f\n",x1[i],y1[i]);
	}
  return 0;
}

C++: #include <iostream>
#include <iomanip>
using namespace std;
 
int main(){
    double a,b,c,d,e,f,x,y;
    while(cin >> a >> b >> c >> d >> e >> f){
        double detA;
        detA = a * e - b * d;
        x = (c * e - f * b) / detA;
        y = (a * f - c * d) / detA;
        cout << fixed << setprecision(3) << x + 0.0001 << " " << setprecision(3) << y + 0.0001 << endl;
    }
}

C++: #include<iostream>
#include<algorithm>
#include<complex>
#include<iomanip>
using namespace std;
int main(){
	double a,b,c,d,e,f,x,y;
	int t=85000;
	for(int i=t;i;i--){
		for(int j=i;j;j--){
			if(i+j==2)a=0.0;
		}
	}
	while(cin>>a){cin>>b>>c>>d>>e>>f;
		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;
		cout<<fixed<<setprecision(3)<<x<<" ";
		cout<<fixed<<setprecision(3)<<y<<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\n", a, b);
	} 

	return 0;
}

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

using db = double;
const db eps = 1e-6;

int main() {
	cout << fixed << setprecision(3);
	ios :: sync_with_stdio(false);
	db a, b, c, d, e, f;
	while(cin >> a >> b >> c >> d >> e >> f) {
		db x = (c * e - b * f) / (a * e - b * d);
		db y = (a * f - c * d) / (a * e - b * d);
		if(x > -eps && x < eps) x = 0;
		if(y > -eps && y < eps) y = 0;
		cout << x << ' ' << y << '\n';
	}
	return 0;
}

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

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

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

    x = (double)(c*e-b*f)/(a*e-b*d);
    y = (double)(a*f-c*d)/(a*e-b*d);
    //if(x == 0){x = 0;}
    //if(y == 0){y = 0;}
    printf("%.3f %.3f\n",x,y);

  }
}

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)
      {
            a = a * d / a;
            b = b * d / a;
            c = c * d / a;
 
            d = d - a;           // d = 0
            e = e - b;
            f = f - c;
 
            e = e * b / e;
            f = f * b / e;
 
            b = b - e;            // b = 0
            c = c - f;
 
            a = a / a;
            c = c / a;            // x = c
 
            e = e / e;
            f = f / e;            // y = f
 
            cout << fixed << setprecision(3) << c << " " << fixed << setprecision(3) << f << endl;
      }
 
      return 0;
}

C++: //
//  main.cpp
//  Sample
//
//  Created by h3037183 on 2017/07/31.
//  Copyright ?? 2017??´ ?°????. All rights reserved.
//

#include <iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main(){
    double a,b,c,d,e,f,x,y;
    while(cin>>a>>b>>c>>d>>e>>f){
    cin>>a>>b>>c>>d>>e>>f;
    x=(c*e-b*f)/(a*e-b*d);
    y=(c*d-f*a)/(b*d-a*e);
        if(x==0)x=0;
        if(y==0)y=0;
    printf("%.3lf %.3lf",x,y);
    cout<<endl;
    }
    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) {
    int div = a;
    a /= div, b /= div, c /= div;

    int time = -d;
    d += a * time, e += b * time, f += c * time;

    double y = f / e;
    double x = c - b * y;

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

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


using namespace std;

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

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

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

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

    return 0;
    
    }