Go: package main

import (
        "fmt"
        "bufio"
        "os"
        "math"
)

func main() {
        var a, b, c, d, e, f float64
        sc := bufio.NewScanner(os.Stdin)
        for sc.Scan() {
                fmt.Sscanf(sc.Text(), "%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f)

                det := a*e - b*d
                x := (e*c - b*f) / det
                y := (a*f - c*d) / det
                if x == 0.0 {
                        x = math.Abs(x)
                }
                if y == 0.0 {
                        y = math.Abs(y)
                }
                fmt.Printf("%.3f %.3f\n", x, y)
        }
}

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

#define REP(i, a) for(int i=0;i<(int)a;++i)
using namespace std;

void solver() {
    double a, b, c, d, e, f;
    while (cin >> a >> b >> c >> d >> e >> f) {
        auto x = (c * e - f * b) / (a * e - b * d);
        auto y = (c - a * x) / b;
        if(x<0.0005) x=0;
        if(y<0.0005) y=0;
        printf("%.3f %.3f\n",x,y);
    }
}

int main() {
    solver();
    return 0;
}

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

using namespace std;

int main(){

  int i=0;
  float a, b, c, d, e, f;
  float temp;
  float x, y;

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

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

    cout << fixed << setprecision(3) << x << " " << y << "\n";
  }

  return 0;
}

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

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

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

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

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

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

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

int main()
{
	int a,b,c,d,e,f;
	double x,y;
	cin>>a>>b>>c>>d>>e>>f
	
		-1000 <= a, b, c, d, e, f <= 1000;
		x= (c*e-b*f)/(a*e-b*d);
		y= (c*d-a*f)/(b*d-a*e);
		if(x == -0.00){x=0.00;}
		if(y == -0.00){y=0.00;}
		cout<<setprecision(3)<<fixed;
		cout<<x<<" "<<y<<endl;
	
	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) {
        double x = (b*f - c*e)/(b*d - a*e);
        double y = (a*f - c*d)/(a*e - b*d);
  if(x == 0){x = 0;}
  if(y == 0){y = 0;}
        printf("%.3f %.3f\n", x, y);
    }
    return 0;
}

C++: #include<cstdio>
int main(){
    float a,b,c,d,e,f,x,y;
    while(scanf("%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f)!=EOF){
        x=(c*e-f*b)/(a*e-d*b);
        y=(c*d-a*f)/(b*d-e*a);
        if(x==0)    x=0;
        if(y==0)    y=0;
        printf("%.3f %.3f\n",x, y);
    }
    return 0;
}
/*int main(){
	float a,b,c,d,e,f,x,y,i,n;
	//while(cin >> a >> b >> c >> d >> e >> f){
	while(scanf("%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f)!=EOF){
		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;
		printf("%.3f %.3f\n",x ,y);
	}
	return 0;
}*/

C++: #include <iostream>
#include <iomanip>
using namespace std;
int main(void){
    // Here your code !
    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 = (a * f - c * d) / (a * e - b * d);
        x *= 1000; x = x + (x > 0 ? 0.5 : -0.5); x = (int)x;
        y *= 1000; y = y + (y > 0 ? 0.5 : -0.5); y = (int)y;
        //cout << %.3f %.3f\n << x / 1000 << y / 1000 << endl;
        cout << fixed << setprecision(4) << x /1000 << " " << y / 1000 <<endl;
    }
    return 0;
}

C++: #define _USE_MATH_DEFINES

#include <iostream>
#include <string>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <utility>
#include <vector>
#include <numeric>

using namespace std;

int main()
{
	double a, b, c, d, e, f;
	for (; cin >> a >> b >> c >> d >> e >> f;)
	{
		double x, y;
		if (a == 0 || b == 0 || d == 0 || e == 0)
		{
			if (a == 0)
			{
				y = c / b;
				x = (f - e * y) / d;
			}
			else if (b == 0)
			{
				x = c / a;
				y = (f - d * x) / e;
			}

			if (d == 0)
			{
				y = f / e;
				x = (c - b * y) / a;
			}
			else if (e == 0)
			{
				x = f / d;
				y = (c - a * x) / b;
			}
		}
		else
		{
			double a0 = a * e;
			double c0 = c * e;

			double d0 = d * b;
			double f0 = f * b;

			x = (f0 - c0) / (d0 - a0);

			y = (c - a * x) / b;
		}

		cout << fixed << setprecision(3) << x << " " << y << endl;

	}
}

C++: #include <stdio.h>

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

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

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

using namespace std;

double solutionY();
double solutionX(double);
double a1,b1,c1,d1,e1,f1;

int main(){
  while(cin >> a1 >> b1 >> c1 >> d1 >> e1 >> f1){
    double x,y;
    
    y = solutionY();
    x = solutionX(y);
    
    cout << fixed << setprecision(3) << x << " " << y << endl ;
  }
  return 0;
}

double solutionY(){
  double b,c,e,f;
  b = b1/a1;
  c = c1/a1;

  e = e1/d1;
  f = f1/d1;
  
  return (c - f)/(b - e);
}

double solutionX(double y){
  double b,c;
  b = b1/a1;
  c = c1/a1;
  
  return (c - b*y);
}

C++: #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
double gcd( double m, double n );
double lcm( double m, double n );
int main(int argc, const char * argv[])
{
    double a=0.0;
    double b=0.0;
    double c=0.0;
    double d=0.0;
    double e=0.0;
    double f=0.0;
    double x=0.0;
    double y=0.0;
    int end=0;
    
    while(scanf("%d",&end)!=EOF){
        a=end;
        scanf("%lf",&b);
        scanf("%lf",&c);
        scanf("%lf",&d);
        scanf("%lf",&e);
        scanf("%lf",&f);
        double ad = lcm( a,d );
        printf("%lf\n",ad);
        
        double a2 = ad/a;
        double b2 = b*a2;
        double c2 = c*a2;
        
        double d2 = ad/d;
        double e2 = e*d2;
        double f2 = f*d2;
        
        y = (c2-f2)/(b2-e2);
        x = (c-b*y)/a;
        
        printf("%.3lf",x);
        printf(" ");
        printf("%.3lf\n",y);
        
    }
    
}
double gcd( double m, double n )
{
	if ( ( 0.0 == m ) || ( 0.0 == n ) )
		return 0;
	while( m != n )
	{
		if ( m > n ) m = m - n;
		else         n = n - m;
	}
	return m;
}

double lcm( double m, double n )
{
	if ( ( 0.0 == m ) || ( 0.0 == n ) )
		return 0;
	
	return ((m / gcd(m, n)) * n);
}

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
#define REP(i,N) for(int i = 0; i < (int)N; i++)

double det(double a1,double a2,double a3,double a4){
	return a1*a4-a2*a3;
}

int main(){
	double a,b,c,d,e,f;
	while(cin >> a >> b >> c >> d >> e >> f){
		double g,h,i;
		g = det(a,b,d,e);
		h = det(c,b,f,e);
		i = det(a,c,d,f);
		cout << h/g << " " << i/g << endl;
	}
	return 0;
}

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

using namespace std;

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

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

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

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

    Y*=10000.0;
    if((int)Y%10>4)Y+=1.0;
    Y/=10000.0;
    X*=10000.0;
    if((int)X%10>4)X+=1.0;
    X/=10000.0;
    printf("%.3f %.3f\n",X,Y);
    
  }
  
}