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<iostream>
#include<algorithm>
#include<cmath>
#include <iomanip>
	
using namespace std;


double sisyagonyu(double num, int keta){

    if(keta < 1)return num;
    
    int i  = num * pow(10, keta);
    int sg = num * pow(10, keta + 1) - i * 10;
    
    
    if(sg >= 5)i++;
    else if(sg <= -5)i--;

    return i / pow(10.0, keta);
};

int main(){

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

        cout << setiosflags(ios::fixed) << setprecision(3);
        cout << sisyagonyu(x, 3) << ' ' << sisyagonyu(y, 3)  << endl;
     }
         
	return 0;
}

C++: #include <iostream>
 
using namespace std;
 
int main(int argc, char **argv)
{
    double a, b, c, d, e, f, tmp, s, t;
     
    while((cin >> a >> b >> c >> d >> e >> f)){
        tmp = (a*e-b*d);
        s = ((e*c-b*f)/tmp);
        t = ((a*f-d*c)/tmp);
         
        if(s == -0.0){
            s = 0.0;
        }
        if(t == -0.0){
            t = 0.0;
        }
        printf("%.3f %.3fn", s, t);
    }
     
    return 0;
}

C++: #include <cstdio>

int main (int argc, char *argv[]) {
	using namespace std;
	int a, b, c, d, e, f;
	while (EOF != fscanf(stdin, "%d %d %d %d %d %d\n", &a, &b, &c, &d, &e, &f)) {
		float tmp1 = static_cast<float>(f)-(static_cast<float>(c)*static_cast<float>(d)/static_cast<float>(a));
		float tmp2 = static_cast<float>(e)-(static_cast<float>(b)*static_cast<float>(d)/static_cast<float>(a));
		float y = tmp1/tmp2;
		float x = (c - b * y) / a;
		printf("%f %f\n", x, y);		
		//printf("y=%f\n", (f-(c*d/a))/(e-(b*d/a)));
	}
	
	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);}
		if(y==-0.000){y=0;}
		x=(c-b*y)/a;
		printf("%1.3lf %1.3lf\n",x,y);
	}
	return 0;
}

C++: #include<stdio.h>
int main(void){

	double a, b, c, d, e, f;
	double A,B;
	double x, y;

	while(scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF){
		 
	 
	 if ( (a > 0 && d < 0)|| (a > 0 && d > 0)) {
		A = c*d - f*a;
		B = b*d - e*a;
        y = A / B;
    }
    
    else if ((a < 0 && d > 0) || (a < 0 && d < 0)) {
		A = c*d + f*a;
		B = b*d + e*a;
        y = A / B;
    }
	
    x = (c - y * b) / a;
	printf("%.3lf %.3lf\n" ,x , y);
	}
	return 0;

}

C++: #include<iostream>
#include<iomanip>
#include<cstdio>
#define eps 1e-9
using namespace std;

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

    while(cin>>a>>b>>c>>d>>e>>f){
        x = ((e*c)-(b*f))/((a*e) - (b*d)) ;
        y = ((a*f) - (c*d))/((a*e) - (b*d)) ;

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

C++: #include <cstdio>
#define LOOP(index,times) for(int index=0;index<times;index++)
using namespace std;

int main(){

float l[6];
float x,y;

while(scanf("%f %f %f %f %f %f",&l[0],&l[1],&l[2],&l[3],&l[4],&l[5]) != EOF){
	
	x=(l[2]*l[4]-l[1]*l[5])/(l[0]*l[4]-l[1]*l[3]);
	y=(l[2]*l[3]-l[0]*l[5])/(l[1]*l[3]-l[0]*l[4]);
	if(x==0)x=0;
	if(y==0)y=0;
	printf("%.3lf %.3lf\n",x,y);		

}

return 0;		
}

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

float gcd(float &m, float &n) {
	int a, b, t;
	a = (int)m;
	b = (int)n;
	while (1) {
		if (b==0) return (float)a;
		t = b;
		b = a % b;
		a = t;
	}
}

int main() {
	float a, b, c, d, e, f;
	float t, u, v;
	float x, y;
	
	while (1) {
		cin>>a>>b>>c>>d>>e>>f;
		if (cin.eof()) break;

		if (a<0.0 && d>=0.0) {
			a *= -1;
			b *= -1;
			c *= -1;
		} else if (a>=0.0 && d<0.0) {
			d *= -1;
			e *= -1;
			f *= -1;
		}
		t = a * d;
		b *= d;
		c *= d;
		e *= a;
		f *= a;
		y = (c - f)/(b - e);
		x = c - b * y;

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

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

using namespace std;

typedef struct Shiki{
  double a,b,c;//ax+by=c
  double x,y;
};

Shiki Equation (Shiki, Shiki);

main(){
  Shiki shiki1,shiki2;
  vector<Shiki> ans;
  int i=0;
  
  while(cin){

    cin>>shiki1.a>>shiki1.b>>shiki1.c>>shiki2.a>>shiki2.b>>shiki2.c;
    ans.push_back(Equation(shiki1,shiki2));
    i++;
    
  }
  for(int j=0;j<i-1;j++){
    cout<< fixed << setprecision(4) << ans[j].x << " " << ans[j].y << endl; 
  }
}

Shiki Equation (Shiki A, Shiki B){
  Shiki ans,preA;
  int x,y,aa,ba;
  
  preA = A;

  aa = A.a;
  ba = B.a;
  
  A.a *= ba;
  A.b *= ba;
  A.c *= ba;
  
  B.a *= aa;
  B.b *= aa;
  B.c *= aa;
  
  ans.a = 0;
  ans.b = A.b - B.b;
  ans.c = A.c - B.c;
  ans.y = ans.c / ans.b;
  ans.x = (preA.c - preA.b*ans.y)/preA.a;
  
  if((int)(ans.y*1000)%10 >= 5)ans.y += 0.0001;
  if((int)(ans.y*1000)%10 >= 5)ans.x += 0.0001;
  
  return ans;
}

C++: #include <cstdio>

using namespace std;

int main()
{
  long long a, b, c, d, e, f;
  while(scanf("%lld%lld%lld%lld%lld%lld", &a, &b, &c, &d, &e, &f) != -1){
    double y = 0, x = 0;
    long long g = e * a;
    long long h = f * a;
    long long i = b * d;
    long long j = c * d;
    long long k = i - g;
    long long l = j - h;
    if(k == 0 && l == 0) goto end;
    y = (double)l / (double)k;
    x = (double)(c - b*y) / (double)a;

    if(y > 0) y += 0.0005; else if(y < 0) y -= 0.0005;
    if(x > 0) x += 0.0005; else if(x < 0) x -= 0.0005;
    y = ((int)(y * 1000)) / 1000; 
    x = ((int)(x * 1000)) / 1000;
  end:
    printf("%.3f %.3f\n", x, y);
  }
  return 0;
}

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

int main(){

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

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

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

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

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

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