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++: #include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef complex<double> P;
typedef pair<int,int> pii;
#define REP(i,n) for(ll i=0;i<n;++i)
#define REPR(i,n) for(ll i=1;i<n;++i)
#define FOR(i,a,b) for(ll i=a;i<b;++i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define MOD (ll)(1e9+7)
#define ADD(a,b) a=((a)+(b))%MOD
#define FIX(a) ((a)%MOD+MOD)%MOD

int main(){
  double a,b,c,d,e,f;
  while(~scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f)){
    // ax+by=c
    // dx+ey=f
    double x,y;
    x = (b*f-c*e)/(b*d-a*e);
    y = (f-d*x)/e;
    if(abs(x)<1e-9) x = abs(x);
    if(abs(y)<1e-9) y = abs(y);
    // x = round(x*1000.0)/1000.0;
    // y = round(y*1000.0)/1000.0;
    printf("%.3lf %.3lf\n",x,y);
  }
  return 0;
}

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

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

using namespace std;

int main(){
	
	for(;;){	
			double a[6];

			for(int i=0; i<6; i++){
				cin >> a[i];
			}

			double x,y;

			y=(a[2]/a[0]-a[5]/a[3])/(a[1]/a[0]-a[4]/a[3]);

			x = a[2]/a[0] - a[1]/a[0] * y;

			
			double diff = 0.5;

			x<0?(diff=-0.5):(diff=0.5);
			x = (int)(x*1000+diff);
			
			y<0?(diff=-0.5):(diff=0.5); 
			y = (int)(y*1000+diff); 
			

			x /= 1000;y/=1000;
			

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

C++: #include<iostream>
using namespace std;
int main(){
int a,b,c,d,e,f;
float A,B,C,D,E,F,X,Y;
while(cin>>a>>b>>c>>d>>e>>f){
E=e*a/d;
F=f*a/d;
Y=(c-F)/(b-E);
X=c-b*Y/a;
cout<<X<<Y<<endl;
}
}

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

int main(){
	double a[6];
	double x,y;
	while(cin>>a[0]>>a[1]>>a[2]>>a[3]>>a[4]>>a[5]){
		double b=a[0]*a[4]-a[1]*a[3];
		double c=a[0];
		a[0]=a[4];
		a[4]=c;
		a[1]*=-1.0;
		a[3]*=-1.0;
		x=(a[0]*a[2]+a[1]*a[5])/b;
		y=(a[3]*a[2]+a[4]*a[5])/b;
		if(x=-0.0)x=0.0;
		if(y=-0.0)y=0.0;
		printf("%.3f %.3f\n",x,y);
	}
	


	return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef complex<double> P;
typedef pair<int,int> pii;
#define REP(i,n) for(ll i=0;i<n;++i)
#define REPR(i,n) for(ll i=1;i<n;++i)
#define FOR(i,a,b) for(ll i=a;i<b;++i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define MOD (ll)(1e9+7)
#define ADD(a,b) a=((a)+(b))%MOD
#define FIX(a) ((a)%MOD+MOD)%MOD

int main(){
  double a,b,c,d,e,f;
  while(~scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f)){
    // ax+by=c
    // dx+ey=f
    double x,y;
    if(abs(b)<1e-9){
      x = c/a;
      y = (f-d*x)/e;
    }else{
      x = (b*f-c*e)/(b*d-a*e);
      y = (f-d*x)/e;
    }
    if(abs(x)<1e-9) x = abs(x);
    printf("%.3f %.3f\n",x,y);
  }
  return 0;
}

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

using namespace std;

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

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


double a,b,c,d,e,f;
double A,B,C,D;
int main(){
  while(scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f) !=EOF){
    if(a == 0){
      A =c/b;
      B = (f-e*A)/d;
      }
    if(b == 0){
      B = c/a;
      A = (f-d*B)/e;
    }
    if(d == 0){
      A =f/e;
      B = (c-b*A)/a;
    }
    if(e == 0){
      B =f/c;
      A =(c -a*B)/b;
    }
    if( a != 0&& b!=0&& d!=0 &&e!=0){
      b/=a;
      c/=a;
      a/=a;
      
      e/=d;
      f/=d;
      d/=d;
      A =(c-f)/(b-e);
      B =(c-b*A);
    }
    
    A =floor((A+0.0005)*1000)/1000;//小数第4位を四捨五入
    B =floor((B+0.0005)*1000)/1000;
    printf("%.3f %.3f\n",B,A);
  }
  return 0;
}

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

int main()
{
  int 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 = (c*d - a*f)/(b*d - a*e);

      if(x == 0)
	{
	  x = 0.000;
	}
      if(y == 0)
	{
	  y = 0.000;
	}
      
      
      printf("%.3f %.3f\n",x,y);
      
    }

  return 0;
}

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

int main() {
	// your code goes here

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

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

    double y = (a*f-c*d)/(a*e-d*b);
    if(y == -0.0){
      y = 0.0;
    }

    double x = (c-b*y)/a;
    if(x == -0.0){
      x = 0.0;
    }

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

  }
	return 0;
}

C++: #include <stdio.h>

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

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

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

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


double a,b,c,d,e,f;
double A,B;//x,y座標
int main(){
  while(scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f) !=EOF){
    B =(c*e-f*b)/(a*e-b*d);
    A = (c -b*A)/a;
    
    A =floor((A+0.0005)*1000)/1000;//小数第4位を四捨五入
    B =floor((B+0.0005)*1000)/1000;
    printf("%.3f %.3f\n",B,A);
  }
  return 0;
}

C++: #include<stdio.h>
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)
    {
        y=(a*f-c*d)/(a*e-d*b);
        x=(c-b*y)/a;
        printf("%.3f %.3f\n",x,y);
    }
    return 0;
}